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
4a139f6c
Commit
4a139f6c
authored
Feb 18, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
943bad2f
1df50a44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
21 deletions
+40
-21
weblate/lang/models.py
weblate/lang/models.py
+36
-20
weblate/trans/admin_views.py
weblate/trans/admin_views.py
+4
-1
No files found.
weblate/lang/models.py
View file @
4a139f6c
...
...
@@ -173,22 +173,9 @@ class LanguageManager(models.Manager):
if
not
update
and
not
created
:
continue
# Fixups (mostly shortening) of langauge names
if
code
==
'ia'
:
lang
.
name
=
'Interlingua'
elif
code
==
'el'
:
lang
.
name
=
'Greek'
elif
code
==
'st'
:
lang
.
name
=
'Sotho'
elif
code
==
'oc'
:
lang
.
name
=
'Occitan'
elif
code
==
'nb'
:
lang
.
name
=
'Norwegian Bokmål'
elif
code
==
'pa'
:
lang
.
name
=
'Punjabi'
else
:
# Standard ttkit language name
lang
.
name
=
props
[
0
].
split
(
';'
)[
0
]
# Set language name
lang
.
name
=
props
[
0
].
split
(
';'
)[
0
]
lang
.
fixup_name
()
# Read values
lang
.
nplurals
=
props
[
1
]
...
...
@@ -211,10 +198,8 @@ class LanguageManager(models.Manager):
lang
.
nplurals
=
2
lang
.
pluralequation
=
'n != 1'
if
code
in
data
.
RTL_LANGS
:
lang
.
direction
=
'rtl'
else
:
lang
.
direction
=
'ltr'
# Set language direction
lang
.
set_direction
()
# Get plural type
lang
.
plural_tupe
=
get_plural_type
(
...
...
@@ -416,4 +401,35 @@ class Language(models.Model):
return
round
(
translated
*
100.0
/
total
,
1
)
def
get_html
(
self
):
'''
Returns html attributes for markup in this language, includes
language and direction.
'''
return
'lang="%s" dir="%s"'
%
(
self
.
code
,
self
.
direction
)
def
fixup_name
(
self
):
'''
Fixes name, in most cases when wrong one is provided by ttkit.
'''
# Fixups (mostly shortening) of langauge names
if
self
.
code
==
'ia'
:
self
.
name
=
'Interlingua'
elif
self
.
code
==
'el'
:
self
.
name
=
'Greek'
elif
self
.
code
==
'st'
:
self
.
name
=
'Sotho'
elif
self
.
code
==
'oc'
:
self
.
name
=
'Occitan'
elif
self
.
code
==
'nb'
:
self
.
name
=
'Norwegian Bokmål'
elif
self
.
code
==
'pa'
:
self
.
name
=
'Punjabi'
def
set_direction
(
self
):
'''
Sets default direction for language.
'''
if
self
.
code
in
data
.
RTL_LANGS
:
self
.
direction
=
'rtl'
else
:
self
.
direction
=
'ltr'
weblate/trans/admin_views.py
View file @
4a139f6c
...
...
@@ -31,6 +31,9 @@ import weblate
import
os
# List of default domain names on which warn user
DEFAULT_DOMAINS
=
(
'example.net'
,
'example.com'
)
@
staff_member_required
def
report
(
request
):
...
...
@@ -57,7 +60,7 @@ def performance(request):
# Check for domain configuration
checks
.
append
((
_
(
'Site domain'
),
Site
.
objects
.
get_current
().
domain
not
in
(
'example.net'
,
'example.com'
)
,
Site
.
objects
.
get_current
().
domain
not
in
DEFAULT_DOMAINS
,
'production-site'
,
))
# Check database being used
...
...
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