Re: Languages, translations, locales, timezones, keyboard layouts and the lang-table

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

 




----- Original Message -----
> Martin Gracik (mgracik@xxxxxxxxxx) said:
> > So I was looking at language.py, localeinfo.py and the lang-table
> > file,
> > and here's a sample line from lang-table:
> > 
> > Czech	cs	True	cs_CZ.UTF-8	cz-lat2	Europe/Prague
> > 
> > In my code I got "cs_CZ", "Czech" and "Europe/Prague" figured out.
> > I also
> > have the native language name, but some problems arise with the
> > other
> > columns. What is the 2nd column (short name) for? Do we need it?
> > And if
> > yes, is there some standard where I can get this mapping? Most of
> > the short
> > names are just the language name from the locale, but there are
> > some
> > exceptions where we also use the territory part for the short name
> > to
> > differentiate between the languages, for example:
> 
> It's essentially the short form of the locale. But I don't think we
> use
> it for anything any more. *However*, if we're setting languages for
> the transaction/langpack plugin, we need to (for example) set both
> 'cs_CZ' and 'cs' as allowed langauges.

For this it should be enough to just have the "cs_CZ" string, and if needed expand it to "cs_CZ" and "cs", we don't need to take it from any database, right?

> 
> > Another problem is the 3rd column "text mode supported". Any ideas
> > how
> > we can get rid of this information from the lang-table?
> 
> Drop text mode! (You knew that was coming.)
> 
> The algorithm you want to use for supporting text mode is
> essentially:
> 
> - Is it a Latin or Cyrillic script -> yes
> - Otherwise -> no

How can I know if a locale is latin/cyrillic or not?

> 
> In lang.sh, we explicitly blacklist ja, ko, si, zh, ar, fa, he, and
> any *_IN that isn't English, but  there's probably a better way to do
> this.
> 
> > The last part (5th column) is the preferred keyboard layout, which
> > I
> > think we can get from system-config-keyboard, as we do try in
> > language.py
> > now.
> 
> That's just moving it to another lookup table, though - what happnes
> if
> the s-c-keyboard code goes away?

I think you have to have a lookup table that maps locale/language to a default keyboard layout, I don't see a way of guessing it from the language name or locale. The point is that we don't need to maintain the table in anaconda. Do you know about some other tool/package that provides this language->keyboard layout mappings?

For example the territory->timezones mappings are in pytz, or it can be parsed from zonetab, but I haven't found anything similar with the keyboard layouts.

> 
> Bill
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux