]>
Commit | Line | Data |
---|---|---|
f22ab085 MT |
1 | #!/usr/bin/python |
2 | ||
3 | import gettext | |
4 | ||
5 | TEXTDOMAIN = "ddns" | |
6 | ||
7 | N_ = lambda x: x | |
8 | ||
9 | def _(singular, plural=None, n=None): | |
10 | """ | |
11 | A function that returnes the translation of a string if available. | |
12 | ||
13 | The language is taken from the system environment. | |
14 | """ | |
15 | if not plural is None: | |
16 | assert n is not None | |
17 | return gettext.dngettext(TEXTDOMAIN, singular, plural, n) | |
18 | ||
19 | return gettext.dgettext(TEXTDOMAIN, singular) | |
20 |