@robocoder opened this Issue on January 15th 2009 Contributor
  • core/Common.php: extractLanguageCodeFromBrowserLanguage returns the country code;
    should rename this to extractCountryCodeFromBrowserLanguage and add a new extractLanguageCodeFromBrowserLanguage function
  • plugins/LanguagesManager/LanguagesManager.php: calls above function, extractLanguageCodeFromBrowserLanguage, expecting a language code, but for "en-ca", it gets "ca" (Catal) instead of "en"
  • Visitors | Locations & providers | Countries data table shows "Unknown" for "en-US"; need to call strtolower(), probably in core/Common.php's getBrowserlanguage()
@robocoder commented on February 21st 2009 Contributor

Attachment:
504.diffs

@robocoder commented on February 21st 2009 Contributor

Attachment: new
LanguageToCountry.php

@robocoder commented on February 14th 2009 Contributor

Tasks from #504:

  • rename lang/cn.php to lang/zh-cn.php
  • rename lang/tw.php to lang/zh-tw.php

I'm guessing this one should be renamed too (judging from General_Locale):

  • rename lang/pt.php to lang/pt-br.php
@robocoder commented on February 21st 2009 Contributor

Updated patch (and new file):

  • config/global.ini.php: added config option 'enable_language_to_country_guess' to turn on the language to country guess (when no region provided in the preferred language tag)
  • core/DataFiles/LanguageToCountry.php: new
  • core/DataFiles/Countries.php: updated with respect to ISO 3166-1 alpha-2 list
  • lang/en.php: updated with respect to above
  • tests/core/Common.test.php: more tests
  • core/Common.php: lots of changes
@mattab commented on March 1st 2009 Owner

end of fix in [931]; thanks anthon!

@robocoder commented on March 28th 2009 Contributor

(In [1038]) refs #504 - check that valid_languages and valid_countries is not null;
http://ca2.php.net/manual/en/function.in-array.php#86695 describes
in_array() returning true if haystack is 0 or false, and not in strict
mode

This Issue was closed on March 28th 2009
Powered by GitHub Issue Mirror