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
b68fd172
Commit
b68fd172
authored
Feb 27, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Po file loading
parent
6538ce21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
trans/models.py
trans/models.py
+11
-0
No files found.
trans/models.py
View file @
b68fd172
...
...
@@ -5,6 +5,7 @@ from glob import glob
import
os
import
os.path
import
git
from
translate.storage
import
factory
from
trans.managers
import
TranslationManager
...
...
@@ -171,10 +172,20 @@ class Translation(models.Model):
oldunits
=
set
(
self
.
unit_set
.
all
().
values_list
(
'id'
,
flat
=
True
))
# Load po file
store
=
factory
.
getobject
(
os
.
path
.
join
(
self
.
subproject
.
get_path
(),
self
.
filename
))
for
unit
in
store
.
units
:
print
unit
# Update revision
self
.
revision
=
blob
.
hexsha
# self.save()
class
Unit
(
models
.
Model
):
translation
=
models
.
ForeignKey
(
Translation
)
location
=
models
.
TextField
()
context
=
models
.
TextField
()
flags
=
models
.
TextField
()
source
=
models
.
TextField
()
target
=
models
.
TextField
()
...
...
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