coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use a language-country localization json file directly.

Haixing-Hu opened this issue · comments

In some cases, we want the website use a language-country localization json file directly, for example, "zh-CN" (means simplified Chinese) or "zh-TW" (means traditional Chinese).

But the current implementation will first try to load the localization json file with the language code (first two character of the "language" parameter), if it failed, the procedure stops.

For example, if we want to load "message-zh-CN.json", the current implementation will first try to load "message-zh.json", and if it failed, the program stops. This means we must provide an empty "message-zh.json", even if it is useless.

Therefore, the logic of the current implementation should be changed: if the program failed to load the json file with language code, it should continue to try to load the json file with the language-country code.

This issue may have some relation with the issue #22.