bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [bug #48481] [PATCH] Allow CLDR plural rules lookup fallba


From: Michele Locati
Subject: [bug-gettext] [bug #48481] [PATCH] Allow CLDR plural rules lookup fallback
Date: Wed, 3 Aug 2016 07:57:56 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36

Follow-up Comment #2, bug #48481 (project gettext):

My code build alternative IDs looking for these chars: '.', '_', '-', '@'.
So, if locale is "address@hidden@baz", we have this list of IDs:
- "address@hidden@baz"
- "address@hidden"
- "foo"

Instead of storing copies of the string, I save the position of the stop
chars. In the above case, we'll have these values:
- locale_lengths_count = 3
- locale_lengths[0] = 11
- locale_lengths[1] = 7
- locale_lengths[2] = 3

When looking for the plural rule, the code compares the IDs using each of
these locale_lengths using xmlStrncmp and stops at the first match.

So, if someone specify "address@hidden", the code won't convert it to "en-us", 
but
simply looks for "address@hidden" and "en".

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48481>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]