Reverse geo lookup - set button active and language

Dirk Hohndel dirk at hohndel.org
Mon Oct 16 02:23:53 PDT 2017


> On Oct 16, 2017, at 5:19 AM, Guillaume Gardet <guillaume.gardet at free.fr> wrote:
>>> It seems to be now "lang=de" what we need and currently we pass "language=de_DE".
>>> Changing the "language" to "lang" is a no-brainer but how can I teach the uiLanguage() function to return the short language string? Or shall I simply truncate it?
>> 
>> Yes, the first two letters are the language, then you get a dash or underscore, then the country.
>> Some languages do not have the country modifier at all.
> 
> Be careful, it seems that some languages are 3 letters: nds_DE (=low german),  mai (=Maithili), maybe more?

I have never seen that. I thought that all languages were supposed to be two letter.
We'd have to check if we do this correctly in Subsurface already... admittedly, we of course support neither of these languages, but we shouldn't break things, either.

So I guess you have to search for a '-' or '_' and grab what's in front of that.

/D

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171016/9c61dd13/attachment.html>


More information about the subsurface mailing list