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
9a7aba99
Commit
9a7aba99
authored
Jun 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try harder to get base language defintion
For en_CA@foo it would first try en_CA and fallback to en.
parent
1568bdff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
lang/models.py
lang/models.py
+15
-2
No files found.
lang/models.py
View file @
9a7aba99
...
...
@@ -171,8 +171,21 @@ class LanguageManager(models.Manager):
pluralequation
=
'(n != 1)'
,
)
# In case this is just a different variant of known language, get
# params from that
# Check for different variant
if
'@'
in
code
:
parts
=
code
.
split
(
'@'
)
try
:
baselang
=
Language
.
objects
.
get
(
code
=
parts
[
0
])
lang
.
name
=
baselang
.
name
lang
.
nplurals
=
baselang
.
nplurals
lang
.
pluralequation
=
baselang
.
pluralequation
lang
.
direction
=
baselang
.
direction
lang
.
save
()
return
lang
except
Language
.
DoesNotExist
:
pass
# Check for different country
if
'_'
in
code
or
'-'
in
code
:
parts
=
code
.
replace
(
'-'
,
'_'
).
split
(
'_'
)
try
:
...
...
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