Update language names to match Google Translate (#33)
* Change language names to match Google Translate
This commit also fixes an issue introduced by commit 04a0e6df
(issue #26),
where language names with underscores in them would not work, because
everything after an underscore is ignored.
* Add test for language names with spaces in them
This commit is contained in:
parent
4e52393ceb
commit
066eff6293
@ -19,8 +19,8 @@ LANGUAGES = {
|
|||||||
'ca': 'catalan',
|
'ca': 'catalan',
|
||||||
'ceb': 'cebuano',
|
'ceb': 'cebuano',
|
||||||
'ny': 'chichewa',
|
'ny': 'chichewa',
|
||||||
'zh-CN': 'chinese_simplified',
|
'zh-cn': 'chinese (simplified)',
|
||||||
'zh-TW': 'chinese_traditional',
|
'zh-tw': 'chinese (traditional)',
|
||||||
'co': 'corsican',
|
'co': 'corsican',
|
||||||
'hr': 'croatian',
|
'hr': 'croatian',
|
||||||
'cs': 'czech',
|
'cs': 'czech',
|
||||||
@ -38,7 +38,7 @@ LANGUAGES = {
|
|||||||
'de': 'german',
|
'de': 'german',
|
||||||
'el': 'greek',
|
'el': 'greek',
|
||||||
'gu': 'gujarati',
|
'gu': 'gujarati',
|
||||||
'ht': 'haitian_creole',
|
'ht': 'haitian creole',
|
||||||
'ha': 'hausa',
|
'ha': 'hausa',
|
||||||
'haw': 'hawaiian',
|
'haw': 'hawaiian',
|
||||||
'iw': 'hebrew',
|
'iw': 'hebrew',
|
||||||
@ -56,7 +56,7 @@ LANGUAGES = {
|
|||||||
'kk': 'kazakh',
|
'kk': 'kazakh',
|
||||||
'km': 'khmer',
|
'km': 'khmer',
|
||||||
'ko': 'korean',
|
'ko': 'korean',
|
||||||
'ku': 'kurdish',
|
'ku': 'kurdish (kurmanji)',
|
||||||
'ky': 'kyrgyz',
|
'ky': 'kyrgyz',
|
||||||
'lo': 'lao',
|
'lo': 'lao',
|
||||||
'la': 'latin',
|
'la': 'latin',
|
||||||
@ -71,7 +71,7 @@ LANGUAGES = {
|
|||||||
'mi': 'maori',
|
'mi': 'maori',
|
||||||
'mr': 'marathi',
|
'mr': 'marathi',
|
||||||
'mn': 'mongolian',
|
'mn': 'mongolian',
|
||||||
'my': 'myanmar',
|
'my': 'myanmar (burmese)',
|
||||||
'ne': 'nepali',
|
'ne': 'nepali',
|
||||||
'no': 'norwegian',
|
'no': 'norwegian',
|
||||||
'ps': 'pashto',
|
'ps': 'pashto',
|
||||||
@ -82,7 +82,7 @@ LANGUAGES = {
|
|||||||
'ro': 'romanian',
|
'ro': 'romanian',
|
||||||
'ru': 'russian',
|
'ru': 'russian',
|
||||||
'sm': 'samoan',
|
'sm': 'samoan',
|
||||||
'gd': 'scots_gaelic',
|
'gd': 'scots gaelic',
|
||||||
'sr': 'serbian',
|
'sr': 'serbian',
|
||||||
'st': 'sesotho',
|
'st': 'sesotho',
|
||||||
'sn': 'shona',
|
'sn': 'shona',
|
||||||
|
@ -42,6 +42,11 @@ def test_language_name(translator):
|
|||||||
assert result.text == u'Dia dhuit'
|
assert result.text == u'Dia dhuit'
|
||||||
|
|
||||||
|
|
||||||
|
def test_language_name_with_space(translator):
|
||||||
|
result = translator.translate(u'Hello', src='en', dest='chinese (simplified)')
|
||||||
|
assert result.dest == 'zh-cn'
|
||||||
|
|
||||||
|
|
||||||
def test_language_rfc1766(translator):
|
def test_language_rfc1766(translator):
|
||||||
result = translator.translate(u'luna', src='it_ch@euro', dest='en')
|
result = translator.translate(u'luna', src='it_ch@euro', dest='en')
|
||||||
assert result.text == u'moon'
|
assert result.text == u'moon'
|
||||||
|
Loading…
Reference in New Issue
Block a user