Proposing changes to l10n codex?
-
How would I propose a change to:
and
https://codex.www.ads-software.com/Function_Reference/load_plugin_textdomain
What I’ve found is that load_plugin_textdomain() is kind of non-intuitive and the documentation doesn’t explain it’s actual operation very well.
Here’s what I’ve discovered:
The locale name is ALWAYS added to the $domain. For example $domain.’-‘.$locale.’.mo’ you’re trying to load. If it doesn’t exist, it doesn’t fall back $domain.’.mo’.
The solution to the problem is to add an action for plugin_locale. The action now looks to see if there’s a locale specific file, and if so it returns it. If it doesn’t exist, it looks for some close matches. E.G. fr_CA is the locale, then I return fr_FR. Similarly de_AT will return de_DE.
Finally, if there aren’t any matches, then I return en_US because I know I always have $domain.’-en_US.mo’.
- The topic ‘Proposing changes to l10n codex?’ is closed to new replies.