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
8b154a6b
Commit
8b154a6b
authored
Apr 10, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get params from language family if it is known
parent
7b6d897a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
trans/managers.py
trans/managers.py
+13
-0
No files found.
trans/managers.py
View file @
8b154a6b
...
...
@@ -82,6 +82,19 @@ class TranslationManager(models.Manager):
nplurals
=
2
,
pluralequation
=
'(n != 1)'
,
)
# In case this is just a different variant of known language, get params from that
if
'_'
in
code
:
try
:
baselang
=
Language
.
objects
.
get
(
code
=
code
.
split
(
'_'
)[
0
])
lang
.
name
=
'%s (generated - %s)'
%
(
baselang
.
name
,
code
,
)
lang
.
nplurals
=
baselang
.
nplurals
lang
.
pluralequation
=
baselang
.
pluralequation
lang
.
save
()
except
Language
.
DoesNotExist
:
pass
translation
,
created
=
self
.
get_or_create
(
language
=
lang
,
subproject
=
subproject
,
...
...
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