[wp-trac] [WordPress Trac] #54858: i18n: Missing locale data if part of the translation are empty
WordPress Trac
noreply at wordpress.org
Thu Jan 20 03:12:09 UTC 2022
#54858: i18n: Missing locale data if part of the translation are empty
--------------------------+------------------------------
Reporter: arthur791004 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by arthur791004):
> Just so I understand thid correctly, somewhere in your application you
are setting the language property, _before WP loads the translations.
> When WP loads the translations but can‘t find any, it overrides the
locale data with an empty object, causing your language property to be
lost.
> Is that correct?
No, the language property comes from translations. Here is the example of
our translation file:
* {"":{"plural_forms":"nplurals=2; plural=n !=
1;","language":"ta_IN","localeSlug":"ta"}, ... }
So, I think we cannot set the language property later. But I can ask
whether our application is able to generate translation files all the time
to avoid falling back to an empty locale data.
> Alternatively, what if core would always set some properties like
language instead of using an empty object?
This sounds good! But I'm not sure what property can be used as the
developers like us have already set some kind of property.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54858#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list