Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
c58bbe4d
Commit
c58bbe4d
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
./translations.py [help] [stats] [update]
parent
668b8857
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/translations.py
+62
-0
62 additions, 0 deletions
scripts/translations.py
with
62 additions
and
0 deletions
scripts/
update_
translations.py
→
scripts/translations.py
100644 → 100755
+
62
−
0
View file @
c58bbe4d
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Dedicated to Yann
import
os
import
sys
stats
=
False
update
=
False
def
visit
(
arg
,
dirname
,
names
):
if
dirname
.
find
(
'
.svn
'
)
!=
-
1
:
return
...
...
@@ -9,16 +16,47 @@ def visit(arg, dirname, names):
path_to_po
=
os
.
path
.
join
(
dirname
,
'
gajim.po
'
)
pos
=
path_to_po
.
find
(
'
po/
'
)
+
3
#3 = len('po/')
name
=
path_to_po
[
pos
:
pos
+
2
]
os
.
system
(
'
msgmerge -q -U ../po/
'
+
name
+
'
/LC_MESSAGES/gajim.po ../gajim.pot
'
)
print
name
,
'
has now:
'
os
.
system
(
'
msgfmt --statistics
'
+
path_to_po
)
if
update
:
os
.
system
(
'
msgmerge -q -U ../po/
'
+
name
+
'
/LC_MESSAGES/gajim.po ../gajim.pot
'
)
if
stats
:
print
name
,
'
has now:
'
os
.
system
(
'
msgfmt --statistics
'
+
path_to_po
)
def
show_help
():
print
sys
.
argv
[
0
],
'
[help] [stats] [update]
'
sys
.
exit
(
0
)
def
update_pot
():
os
.
system
(
'
xgettext -k_ -kN_ -o gajim.pot ../src/*.py ../src/common/*.py ../src/msg.c
'
)
if
__name__
==
'
__main__
'
:
if
os
.
path
.
basename
(
os
.
getcwd
())
!=
'
scripts
'
:
print
'
run me with cwd: scripts
'
sys
.
exit
()
os
.
system
(
'
xgettext -k_ -kN_ -o gajim.pot ../src/*.py ../src/common/*.py ../src/msg.c
'
)
path_to_dir
=
'
../po
'
os
.
path
.
walk
(
path_to_dir
,
visit
,
None
)
if
len
(
sys
.
argv
)
==
2
:
if
sys
.
argv
[
1
].
startswith
(
'
h
'
):
show_help
()
param
=
sys
.
argv
[
1
]
if
param
==
'
stats
'
:
# stats only
stats
=
True
os
.
path
.
walk
(
path_to_dir
,
visit
,
None
)
elif
param
==
'
update
'
:
# update and no stats
update_pot
()
update
=
True
os
.
path
.
walk
(
path_to_dir
,
visit
,
None
)
# update each po & no stats
print
'
Done
'
elif
len
(
sys
.
argv
)
==
1
:
# update & stats
update_pot
()
update
=
True
stats
=
True
os
.
path
.
walk
(
path_to_dir
,
visit
,
None
)
print
'
Done
'
else
:
show_help
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment