Package translate :: Package lang :: Module data
[hide private]
[frames] | no frames]

Module data

source code

This module stores information and functionality that relates to plurals.

Functions [hide private]
 
simplercode(code)
This attempts to simplify the given language code by ignoring country codes, for example.
source code
 
tr_lang(langcode)
Gives a function that can translate a language name, even in the form "language (country)" into the language with iso code langcode.
source code
 
gettext_lang(langcode)
Returns a gettext function to translate language names into the given language.
source code
 
gettext_country(langcode)
Returns a gettext function to translate country names into the given language.
source code
 
normalize(string, normal_form='NFC')
Return a unicode string in its normalized form
source code
 
forceunicode(string)
Helper method to ensure that the parameter becomes unicode if not yet
source code
Variables [hide private]
  languages = {'af': ('Afrikaans', 2, '(n != 1)'), 'ak': ('Akan'...
  iso639 = {}
  iso3166 = {}
  dialectre = re.compile(r'([^\(\s]+)\s*\(([^\)]+)\)')
Function Details [hide private]

normalize(string, normal_form='NFC')

source code 

Return a unicode string in its normalized form

Parameters:
  • sting - The string to be normalized
  • normal_form - NFC (default), NFD, NFCK, NFDK
Returns:
Normalized string

Variables Details [hide private]

languages

Value:
{'af': ('Afrikaans', 2, '(n != 1)'),
 'ak': ('Akan', 2, 'n > 1'),
 'ar': ('Arabic',
        6,
        'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n>=3 && n<=10 ? 3 : n>=11 &&\
 n<=99 ? 4 : 5'),
 'az': ('Azerbaijani', 2, '(n != 1)'),
 'be': ('Belarusian', 3, 'n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=\
...