[wp-trac] [WordPress Trac] #26511: Introduce a locale-switching function
WordPress Trac
noreply at wordpress.org
Sat Sep 24 09:02:56 UTC 2016
#26511: Introduce a locale-switching function
--------------------------------------+------------------------
Reporter: johnbillion | Owner:
Type: feature request | Status: reviewing
Priority: normal | Milestone: 4.7
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------
Comment (by tfrommen):
Replying to [comment:61 ocean90]:
> Something I missed to mention earlier: There is an issue with functions
like `get_post_type_labels()`/`_get_custom_object_labels()`. Post type
labels are initially registered via `register_post_type()` which means
they don't change when calling `switch_to_locale()`. You can see that with
[https://core.trac.wordpress.org/attachment/ticket/29783/user-language-
admin-toolbar.php the example plugin] in the Add New menu for the Post and
Page items.
There are even more issues, for example, when you have a Custom Post Type
or Custom Taxonomy registered by using a translated slug. When you switch
to a different locale, the rewrite rules (and thus the generated
permalinks) do '''not''' get adapted.
The question is if coping with these things should be handled by the
locale switcher, or not.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26511#comment:62>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list