[wp-hackers] What do you name the localization .mo when the locale is not set?

Otto otto at ottodestruct.com
Thu Jun 17 15:13:42 UTC 2010

The default is indeed en_US. See the get_locale() function in the l10n.php file.


On Thu, Jun 17, 2010 at 10:02 AM, Wordpress Developer
<wordpress.development at gmail.com> wrote:
> I'm working on a localized template and have my .mo working fine for default
> installs of WP. Love it: Just use _e('whatever', 'textdomain') and it echos
> out the value based on the "whatever" key.
> Unfortunately, my code fails after taking it from my personal dev
> environment into a professional one. I've troubleshooted what I can and
> think it's because the locale is not set on the new dev environment. I ran
> this code to check:
> <?php
> $locale = get_locale();
> if($locale == "en_US") {
>   echo "english: $locale";
> } else { echo "not english: $locale"; } ?>
> In the working dev environment, it echos out "english: en_US"
> In the non-working dev environment, it echos out "not english: "
> In both installs the WP_Lang constant is not set (wp-config: "define
> ('WPLANG', '');"). It's a bit confusing to me as to why one install defaults
> to en_US (as I might expect) but the other doesn't seem to have the locale
> set at all. In any case, I suspect my .mo is failing because it's named
> en_US.mo in the theme folder and since the locale on the second setup is not
> en_US it's not finding it.
> In any case, I figure my .mo has a chance if I name it the right thing for a
> WP install with no language set. Is there such a namespace? What do you name
> the localization .mo when the locale doesn't seem to be set?
> Thank you!
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list