[sword-devel] Locale - proposal

DM Smith dmsmith at crosswire.org
Fri Jan 3 11:10:14 MST 2014

On Jan 3, 2014, at 11:37 AM, Peter von Kaehne <refdoc at gmx.net> wrote:

>> On Fri, 2014-01-03 at 10:54 -0500, DM Smith wrote:
>> BTW, I like how Java searches for localized resource files. The actual
>> implementation is rather complex (because it searches multiple
>> locations), but to simplify:
>> Given a language code, a country code and a script code (script is new
>> to Java 7), it looks for the most specific first (i.e. using all
>> three) and then looks for a bit less specific (i.e. lang/country and
>> lang/script) and then for least specific (i.e. lang). Failing that it
>> returns the application default, which does not specify any language,
>> country or script.
> The C++ sword engine does not do the search for parents as you explain
> for Java.

Right SWORD looks for exactly what is requested, nothing more. I was suggesting a change to the engine.

Without an engine change you have to have file duplication.

> E.g. there is a locale de. Searching for de_DE should bring up de in
> absence of de_DE, but this does not happen. I have checked that.

In Java looking for de would never find de_DE. For this, your suggestion of renaming the file is needed. de_DE -> de.

However, if a SWORD program only looks for de, it won't find de_DE. The SWORD engine has no fallback.

Your suggestion was that a search for de to find de_DE. This goes from the less specific to the more specific and I don't think that makes sense. And it may come up with two choices as with Portuguese.

> But even if we make the engine's search more intelligent (to search for
> "parent" if the "offspring" search has failed), we still need to create
> duplicate locales for some of the situations where we have no "parent"
> locale, just "offspring" -e.g. in Russian and Arabic.

Yes. In the case of JSword, if we only have one choice, Egyptian Arabic, we make that the default, ar. If we know it should not be the default, we also duplicate it as ar_EG. When we get another version of Arabic, we create ar_XX, or rename ar to ar_EG and create ar since XX is a better default.

And if you have no fallback mechanism, then you have to do it via file duplication.

> Chinese is
> complicated and I do not know what the right solution is. Maybe in some
> places failure is the right answer.

For Chinese JSword assumes that \ in mainland China that Simplified is used and Traditional elsewhere.

The proper way is to support script and have that work. (Which will be when JSword uses Java 7).

So rather than zh_TW and zh_CN you'd have zh_hant and zh_hans.

> Peter
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140103/439a93e6/attachment-0001.p7s>

More information about the sword-devel mailing list