Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
1e40a23e
Commit
1e40a23e
authored
Oct 05, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c8d2ff2b
3de818d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
2 deletions
+52
-2
weblate/html/i18n.html
weblate/html/i18n.html
+2
-0
weblate/lang/data.py
weblate/lang/data.py
+18
-0
weblate/lang/models.py
weblate/lang/models.py
+1
-1
weblate/lang/tests.py
weblate/lang/tests.py
+31
-1
No files found.
weblate/html/i18n.html
View file @
1e40a23e
...
...
@@ -28,6 +28,7 @@ for l in Language.objects.exclude(name__contains='generated').values_list('name'
{% trans "Armenian" %}
{% trans "Assamese" %}
{% trans "Asturian" %}
{% trans "Austrian German" %}
{% trans "Aymará" %}
{% trans "Azerbaijani" %}
{% trans "Bashkir" %}
...
...
@@ -168,6 +169,7 @@ for l in Language.objects.exclude(name__contains='generated').values_list('name'
{% trans "Sundanese" %}
{% trans "Swahili" %}
{% trans "Swedish" %}
{% trans "Swiss High German" %}
{% trans "Tagalog" %}
{% trans "Tajik" %}
{% trans "Tamil" %}
...
...
weblate/lang/data.py
View file @
1e40a23e
...
...
@@ -353,8 +353,26 @@ EXTRALANGS = (
2
,
'(n != 1)'
,
),
(
'de_AT'
,
'Austrian German'
,
2
,
'n != 1'
,
),
(
'de_CH'
,
'Swiss High German'
,
2
,
'n != 1'
,
),
)
NO_CODE_LANGUAGES
=
frozenset
((
'zh_TW'
,
'zh_CN'
,
'zh_Hant'
,
'zh_Hans'
,
'de_AT'
,
'de_CH'
))
# List of defaul languages - the ones, where using
# only language code should be same as this one
# Extracted from locale.alias
...
...
weblate/lang/models.py
View file @
1e40a23e
...
...
@@ -389,7 +389,7 @@ class Language(models.Model, PercentMixin):
if
'('
in
self
.
name
:
return
False
if
self
.
code
in
(
'zh_TW'
,
'zh_CN'
,
'zh_Hant'
,
'zh_Hans'
)
:
if
self
.
code
in
data
.
NO_CODE_LANGUAGES
:
return
False
return
'_'
in
self
.
code
or
'-'
in
self
.
code
...
...
weblate/lang/tests.py
View file @
1e40a23e
...
...
@@ -39,48 +39,63 @@ class LanguagesTest(TestCase):
'cs'
,
'ltr'
,
'(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'
,
'Czech'
,
),
(
'cs (2)'
,
'cs'
,
'ltr'
,
'(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'
,
'Czech'
,
),
(
'czech'
,
'cs'
,
'ltr'
,
'(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'
,
'Czech'
,
),
(
'cs_CZ@hantec'
,
'cs_CZ@hantec'
,
'ltr'
,
'(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'
,
'Czech (cs_CZ@hantec)'
,
),
(
'de-DE'
,
'de'
,
'ltr'
,
'n != 1'
,
'German'
,
),
(
'de_AT'
,
'de_AT'
,
'ltr'
,
'n != 1'
,
'Austrian German'
,
),
(
'de_CZ'
,
'de_CZ'
,
'ltr'
,
'n != 1'
,
'German (de_CZ)'
,
),
(
'portuguese_portugal'
,
'pt_PT'
,
'ltr'
,
'n > 1'
,
'Portuguese (Portugal)'
,
),
(
'pt-rBR'
,
'pt_BR'
,
'ltr'
,
'n > 1'
,
'Portuguese (Brazil)'
,
),
(
'sr_RS@latin'
,
...
...
@@ -88,6 +103,7 @@ class LanguagesTest(TestCase):
'ltr'
,
'n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && '
'(n%100<10 || n%100>=20) ? 1 : 2'
,
'Serbian (latin)'
,
),
(
'sr-RS@latin'
,
...
...
@@ -95,6 +111,7 @@ class LanguagesTest(TestCase):
'ltr'
,
'n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && '
'(n%100<10 || n%100>=20) ? 1 : 2'
,
'Serbian (latin)'
,
),
(
'sr_RS_Latin'
,
...
...
@@ -102,42 +119,49 @@ class LanguagesTest(TestCase):
'ltr'
,
'n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && '
'(n%100<10 || n%100>=20) ? 1 : 2'
,
'Serbian (latin)'
,
),
(
'en_CA_MyVariant'
,
'en_CA@myvariant'
,
'ltr'
,
'n != 1'
,
'English (Canada)'
,
),
(
'en_CZ'
,
'en_CZ'
,
'ltr'
,
'n != 1'
,
'English (en_CZ)'
,
),
(
'zh_CN'
,
'zh_CN'
,
'ltr'
,
'0'
,
'Chinese (China)'
,
),
(
'zh-CN'
,
'zh_CN'
,
'ltr'
,
'0'
,
'Chinese (China)'
,
),
(
'zh-CN@test'
,
'zh_CN@test'
,
'ltr'
,
'0'
,
'Chinese (China)'
,
),
(
'zh-rCN'
,
'zh_CN'
,
'ltr'
,
'0'
,
'Chinese (China)'
,
),
(
'ar'
,
...
...
@@ -145,6 +169,7 @@ class LanguagesTest(TestCase):
'rtl'
,
'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 '
': n%100>=11 ? 4 : 5'
,
'Arabic'
,
),
(
'ar_AA'
,
...
...
@@ -152,6 +177,7 @@ class LanguagesTest(TestCase):
'rtl'
,
'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 '
': n%100>=11 ? 4 : 5'
,
'Arabic'
,
),
(
'ar_XX'
,
...
...
@@ -159,12 +185,14 @@ class LanguagesTest(TestCase):
'rtl'
,
'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 '
': n%100>=11 ? 4 : 5'
,
'Arabic (ar_XX)'
,
),
(
'xx'
,
'xx'
,
'ltr'
,
'n != 1'
,
'xx (generated)'
,
),
)
...
...
@@ -172,7 +200,7 @@ class LanguagesTest(TestCase):
'''
Tests that auto create correctly handles languages
'''
for
original
,
expected
,
direction
,
plurals
in
self
.
TEST_LANGUAGES
:
for
original
,
expected
,
direction
,
plurals
,
name
in
self
.
TEST_LANGUAGES
:
# Create language
lang
=
Language
.
objects
.
auto_get_or_create
(
original
)
# Check language code
...
...
@@ -198,6 +226,8 @@ class LanguagesTest(TestCase):
# Check whether html contains both language code and direction
self
.
assertIn
(
direction
,
lang
.
get_html
())
self
.
assertIn
(
expected
,
lang
.
get_html
())
# Check name
self
.
assertEqual
(
unicode
(
lang
),
name
)
def
test_plurals
(
self
):
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment