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
f66d2a9e
Commit
f66d2a9e
authored
Mar 11, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement unit adding in file format class
parent
61c5862a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
trans/formats.py
trans/formats.py
+11
-0
No files found.
trans/formats.py
View file @
f66d2a9e
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
File format specific behavior.
File format specific behavior.
'''
'''
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
translate.storage.lisa
import
LISAfile
from
translate.storage
import
factory
from
translate.storage
import
factory
import
importlib
import
importlib
import
__builtin__
import
__builtin__
...
@@ -154,6 +155,16 @@ class FileFormat(object):
...
@@ -154,6 +155,16 @@ class FileFormat(object):
return
(
None
,
False
)
return
(
None
,
False
)
def
add_unit
(
self
,
pounit
):
'''
Adds new unit to underlaying store.
'''
if
isinstance
(
self
.
store
,
LISAfile
):
# LISA based stores need to know this
self
.
store
.
addunit
(
pounit
,
new
=
True
)
else
:
self
.
store
.
addunit
(
pounit
)
class
AutoFormat
(
FileFormat
):
class
AutoFormat
(
FileFormat
):
name
=
_
(
'Automatic detection'
)
name
=
_
(
'Automatic detection'
)
...
...
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