Mailinglist Archive: yast-devel (48 mails)

< Previous Next >
[yast-devel] LanguageTag: Language and locale tags (en_US)
We have lots of code where we manipulate strings like "en", "en_US",
"en_US.UTF-8".

As you may guess, manipulating language identifiers as strings is
error prone and inconsistent. I've created a little class,
LanguageTag, to encapsulate the handling.

https://www.rubydoc.info/github/yast/yast-packager/master/LanguageTag

I am quite sure that you will find it lacking, because I thought
YAGNI[3] and only implemented what I strictly needded for my fix[1].
Please let me know if you see a place where this would be useful,
let's use it and improve it.

For reference, https://en.wikipedia.org/wiki/IETF_language_tag or
http://www.langtag.net/ is the standard that I was following, before
scrapping it as too complex for my usecase[2]. Still, we should use
matching concepts and not reinvent wheels.

[1]:
https://github.com/yast/yast-packager/search?q=LanguageTag&unscoped_q=LanguageTag
[2]: https://github.com/yast/yast-packager/pull/441
[3]: https://en.wikipedia.org/wiki/You_aren't_gonna_need_it
--
Martin Vidner, YaST Team
http://en.opensuse.org/User:Mvidner
< Previous Next >
This Thread
  • No further messages