LocaleId doesn't supported locale variant

Issue #459 resolved
Former user created an issue

net.sf.okapi.common.LocaleId doesn't support String with '@' char. as it is valid in GetText. e.g sr@latin

https://www.gnu.org/software/gettext/manual/html_node/Locale-Names.html

'Some locale names use ‘ll_CC.@variant’'

Comments (5)

  1. Jim Hargrave (OLD)

    Java 7 now has much better locale support. We originally started with Java 5 and decided not to use the built-in Java Locale class. We should look at the Java 7 locale class and create a thin LocaleId wrapper around it to get the functionality we need

  2. Mihai Nita

    It does support "sr@latn", but you need to use LocaleId.fromPOSIXLocale("sr@latin")

    Locale ids with @ are a POSIX convention.

    Even the parent topic of the link provided in the initial report is "Setting the POSIX Locale"

    And with the LocaleId update to use ICU the rs@latin is also properly mapped to sr-Latn.

  3. Log in to comment