File: README.md

package info (click to toggle)
langtable 0.0.69-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,900 kB
  • sloc: python: 4,360; makefile: 74; sh: 42
file content (72 lines) | stat: -rw-r--r-- 1,948 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# langtable

[![PyPI version](https://badge.fury.io/py/langtable.svg)](https://badge.fury.io/py/langtable)

Guessing reasonable defaults for locale, keyboard layout, territory, and language.

## Purpose of this package
_langtable_ is used to guess reasonable defaults for locale, keyboard, territory, …, if part of that information is already known. For example, guess the territory and the keyboard layout if the language is known or guess the language and keyboard layout if the territory is already known.

## License

GPLv3+, see the included file “COPYING”.

Translations for languages and territory names are from CLDR which is governed by the Unicode Terms of Use, see the included file “unicode-license.txt”. The short name for this Unicode license is “MIT”. See:

https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT#Modern_Style_without_sublicense_.28Unicode.29

## Installation

To install langtable, run

```
     make install DESTDIR=/usr
```

To create a distribution tarball run
```
     make dist
```
To run the test cases in the source directory:
```
     make check
```

## How to use it

```
import langtable
```

Functions in the public API:

```
     parse_locale()
     list_locales()
     list_keyboards()
     list_common_languages()
     list_common_locales()
     list_common_keyboards()
     list_consolefonts()
     list_inputmethods()
     list_timezones()
     list_scripts()
     language_name()
     territory_name()
     timezone_name()
     languageId()
     territoryId()
     supports_ascii()
     list_all_languages()
     list_all_locales()
     list_all_keyboards()
     list_all_territories()
     list_all_timezones()
     list_all_scripts()
     list_all_input_methods()
     list_all_console_fonts()
```

Some examples to show the usage are found in the documentation of the public functions in `langtable.py`.

Some more examples are in the test cases in the file `test_cases.py`.