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
c1533a82
Commit
c1533a82
authored
Apr 12, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
f10fcacb
6ce90f1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
3 deletions
+41
-3
docs/formats.rst
docs/formats.rst
+32
-0
trans/models/subproject.py
trans/models/subproject.py
+4
-0
trans/models/unitdata.py
trans/models/unitdata.py
+2
-2
trans/tests/views.py
trans/tests/views.py
+3
-1
No files found.
docs/formats.rst
View file @
c1533a82
...
...
@@ -9,6 +9,21 @@ tested formats.
.. seealso:: `Supported formats in translate-toolkit`_
Weblate does support both monolingual and bilingual formats. Bilingual formats
store two languages in single file - source and translation (typical examples
is :ref:`gettext`, :ref:`xliff` or :ref:`apple`). On the other side,
monolingual formats identify the string by ID and each language file contains
only mapping of those to given language (typically :ref:`aresource`). Some file
formats are used in both variants, see detailed description below.
For correct use of monolingual files, Weblate requires access to file
containing complete list of strings to translate with their source - this file
is called :guilabel:`template` within Weblate, though the naming might vary in
your application.
.. _gettext:
GNU Gettext
-----------
...
...
@@ -28,12 +43,16 @@ in their source code and the string needs to be translated to all languages,
including English. Weblate does support this, though you have to choose explicitely
this file format when importing resources into Weblate.
.. _xliff:
XLIFF
-----
XML based format created to standardize translation files, but in the end it
is one of many standards in this area.
XLIFF is usually used as bilingual.
.. seealso:: https://en.wikipedia.org/wiki/XLIFF
Java properties
...
...
@@ -41,6 +60,8 @@ Java properties
Native Java format for translations.
Java properties are usually used as bilingual.
.. seealso:: https://en.wikipedia.org/wiki/.properties
Qt Linguist .ts
...
...
@@ -48,13 +69,20 @@ Qt Linguist .ts
Translation format used in Qt based applications.
Qt Linguist files are used as both bilingual and monolingual.
.. seealso:: http://qt-project.org/doc/qt-4.8/linguist-manual.html
.. _aresource:
Android string resources
------------------------
Android specific file format for translating applications.
Android string resources are monolingual, the :guilabel:`template` file being
stored in different location than others :file:`res/values/strings.xml`.
.. seealso:: https://developer.android.com/guide/topics/resources/string-resource.html
.. note::
...
...
@@ -62,12 +90,16 @@ Android specific file format for translating applications.
This format is not yet supported by Translate-toolkit (merge request is
pending), but Weblate includes own support for it.
.. _apple:
Apple OS X strings
------------------
Apple specific file format for translating applications, used for both OS X
and iPhone/iPad application translations.
Apple OS X strings are usually used as bilingual.
.. seealso:: https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/StringsFiles.html
.. note::
...
...
trans/models/subproject.py
View file @
c1533a82
...
...
@@ -832,6 +832,10 @@ class SubProject(models.Model, PercentMixin, URLMixin):
# Validate template
if
self
.
has_template
():
self
.
clean_template
()
elif
self
.
file_format_cls
.
monolingual
:
raise
ValidationError
(
_
(
'You can not use monolingual translation without template!'
)
)
def
get_template_filename
(
self
):
'''
...
...
trans/models/unitdata.py
View file @
c1533a82
...
...
@@ -76,7 +76,7 @@ class Suggestion(models.Model, RelatedUnitMixin):
def
delete
(
self
,
*
args
,
**
kwargs
):
super
(
Suggestion
,
self
).
delete
(
*
args
,
**
kwargs
)
# Update unit flags
for
unit
in
s
uggestion
.
get_related_units
():
for
unit
in
s
elf
.
get_related_units
():
unit
.
update_has_suggestion
()
def
get_matching_unit
(
self
):
...
...
@@ -120,7 +120,7 @@ class Comment(models.Model, RelatedUnitMixin):
def
delete
(
self
,
*
args
,
**
kwargs
):
super
(
Suggestion
,
self
).
delete
(
*
args
,
**
kwargs
)
# Update unit flags
for
unit
in
s
uggestion
.
get_related_units
():
for
unit
in
s
elf
.
get_related_units
():
unit
.
update_has_comment
()
CHECK_CHOICES
=
[(
x
,
CHECKS
[
x
].
name
)
for
x
in
CHECKS
]
...
...
trans/tests/views.py
View file @
c1533a82
...
...
@@ -358,6 +358,7 @@ class EditTest(ViewTestCase):
self
.
assertEqual
(
unit
.
target
,
'Nazdar svete!'
)
self
.
assertTrue
(
unit
.
has_failing_check
)
self
.
assertEqual
(
len
(
unit
.
checks
()),
2
)
self
.
assertEqual
(
len
(
unit
.
active_checks
()),
2
)
# Ignore one of checks
check_id
=
unit
.
checks
()[
0
].
id
...
...
@@ -368,7 +369,8 @@ class EditTest(ViewTestCase):
# Should have one less check
unit
=
self
.
translation
.
unit_set
.
get
(
source
=
'Hello, world!
\
n
'
)
self
.
assertTrue
(
unit
.
has_failing_check
)
self
.
assertEqual
(
len
(
unit
.
checks
()),
1
)
self
.
assertEqual
(
len
(
unit
.
checks
()),
2
)
self
.
assertEqual
(
len
(
unit
.
active_checks
()),
1
)
# Save with no failing checks
response
=
self
.
edit_unit
(
...
...
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