mozilla-services / FindMyDevice

Find My Device - 🚨🚨This server is obsolete and unsupported.🚨🚨
Mozilla Public License 2.0
13 stars 8 forks source link

Unable to get zh-cn and zh-tw locales #312

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

Found in https://find.dev.mozaws.net/status/ (commit d99f37c)

{"goroutines":12,"status":"ok","version":"1.4-d99f37c"}

Steps to reproduce:

  1. Set your browser's language/locale to "zh-cn" or "zh-tw".
  2. Go to https://find.dev.mozaws.net/

    Actual results:

encontrar_o_meu_dispositivo_ _firefox_os_ _mozilla Figure 1: Those don't look Chinese or Taiwanese. They look like my fallback locale of Portuguese. Note that my Accept-Language header is:

"zh-tw,zh-cn;q=0.93,pt;q=0.86,nl;q=0.79,ja;q=0.71,it;q=0.64,ga;q=0.57,fr;q=0.5,bn;q=0.43,cs;q=0.36,de;q=0.29,hu;q=0.21,en-us;q=0.14,af;q=0.07"

... and it looks like zh_CN and zh_TW should both be valid locales, per the FindMyDevice-l10n repo.

And for the record, here's my JSON response for the /1/l10n/client.json file: encontrar_o_meu_dispositivo_ _firefox_os_ _mozilla_and____github_com__-_peterdehaan_gmail_com_-_gmail

Expected results:

I should have gotten my preferred Chinese/Taiwanese strings instead of (my ultimately third choice) Portuguese. This may be some weird conversion of lowercase_UPPERCASE or dashes-vs_hyphens when conducting the special l10n dance.

jrconlin commented 9 years ago

It looks like what's happening is that the go server is looking for a normalized path where the lang and locale are lower case (e.g. zh_tw). The problem is that the PO files appear to have mixed case for locale (zh_TW, sr_Latn). We should probably normalize the path names to use lower case.

@nchapman is that possible? cc @pdehaan