コード例 #1
0
def lang_en_gb():
    return Language({
        "id": 92,
        "name": "English - United Kingdom",
        "code": "en-gb",
        "direction": "ltr"
    })
コード例 #2
0
def lang_fr():
    return Language({
        "id": 110,
        "name": "French - France",
        "code": "fr-fr",
        "direction": "ltr",
        "override_order": "aaa - naa - French - France"
    })
コード例 #3
0
def lang_ru():
    return Language(
        {
            "id": 190,
            "name": "Russian - Russia",
            "code": "ru-ru",
            "direction": "ltr",
            "override_order": "Russian - Russia"
        }, )
コード例 #4
0
def test_language_object(lang_en_us, lang_en_gb, lang_en_data):
    assert lang_en_us.code == 'en-us'
    assert lang_en_us.id == 94
    assert lang_en_us.lang == 'en'
    assert lang_en_us.name == 'English'

    assert lang_en_us == Language(lang_en_data)

    assert lang_en_us.lang == lang_en_gb.lang
    assert lang_en_us != lang_en_gb
    assert lang_en_us.name == lang_en_gb.name
コード例 #5
0
def lang_en_us(lang_en_data):
    return Language(lang_en_data)
コード例 #6
0
PATTERN_PUSH3 = 'sources/[0-9]/*'
PATTERN_PUSH4 = 'folder1/values-*/strings.xml'

PATTERN_PUSH_INVALID1 = 'i18n/<language_lang>/translations.json'
PATTERN_PUSH_INVALID2 = ''
PATTERN_PUSH_INVALID3 = './sources/'

PATH1 = 'i18n/fr-fr/translations.json'

paths = ('i18n/fr-fr/translations.json', 'i18n/en/translations.json',
         'i18n/en_US/translations.json')

LANGUAGE_EN = Language({
    "id": 94,
    "name": "English - United States",
    "code": "en-us",
    "direction": "ltr",
    "override_order": "aaa - aaa - English - United States"
})

LANGUAGE_FR = Language({
    "id": 110,
    "name": "French - France",
    "code": "fr-fr",
    "direction": "ltr",
    "override_order": "aaa - naa - French - France"
})

LANGUAGE_CN = Language({
    "id": 46,
    "name": "Chinese - China",