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
2142efd0
Commit
2142efd0
authored
Feb 06, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fb6231e2
e69d76b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
weblate/lang/migrations/0004_fill_in_plural_type.py
weblate/lang/migrations/0004_fill_in_plural_type.py
+8
-0
weblate/lang/models.py
weblate/lang/models.py
+2
-0
No files found.
weblate/lang/migrations/0004_fill_in_plural_type.py
View file @
2142efd0
...
@@ -29,10 +29,18 @@ class Migration(DataMigration):
...
@@ -29,10 +29,18 @@ class Migration(DataMigration):
def
forwards
(
self
,
orm
):
def
forwards
(
self
,
orm
):
"Write your forwards methods here."
"Write your forwards methods here."
for
lang
in
orm
.
Language
.
objects
.
all
():
for
lang
in
orm
.
Language
.
objects
.
all
():
# Cleanup plural equation
if
lang
.
pluralequation
[
-
1
]
==
';'
:
lang
.
pluralequation
=
lang
.
pluralequation
[:
-
1
]
if
lang
.
pluralequation
[
0
]
==
'('
and
lang
.
pluralequation
[
-
1
]
==
')'
:
lang
.
pluralequation
=
lang
.
pluralequation
[
1
:
-
1
]
# Add plural type
lang
.
plural_type
=
get_plural_type
(
lang
.
plural_type
=
get_plural_type
(
lang
.
code
,
lang
.
code
,
lang
.
pluralequation
lang
.
pluralequation
)
)
lang
.
save
()
lang
.
save
()
def
backwards
(
self
,
orm
):
def
backwards
(
self
,
orm
):
...
...
weblate/lang/models.py
View file @
2142efd0
...
@@ -210,6 +210,8 @@ def get_plural_type(code, pluralequation):
...
@@ -210,6 +210,8 @@ def get_plural_type(code, pluralequation):
Gets correct plural type for language.
Gets correct plural type for language.
'''
'''
# Remove not needed parenthesis
# Remove not needed parenthesis
if
pluralequation
[
-
1
]
==
';'
:
pluralequation
=
pluralequation
[:
-
1
]
if
pluralequation
[
0
]
==
'('
and
pluralequation
[
-
1
]
==
')'
:
if
pluralequation
[
0
]
==
'('
and
pluralequation
[
-
1
]
==
')'
:
pluralequation
=
pluralequation
[
1
:
-
1
]
pluralequation
=
pluralequation
[
1
:
-
1
]
...
...
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