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
Erik Huelsmann
gajim
Commits
79252a65
Commit
79252a65
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
update_translations.py: a gift to Yann
parent
dc6541ff
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/update_translations.py
+24
-0
24 additions, 0 deletions
scripts/update_translations.py
with
24 additions
and
0 deletions
scripts/translation
_statistic
s.py
→
scripts/
update_
translations.py
+
24
−
0
View file @
79252a65
import
os
import
sys
def
get_output
(
app
,
param
=
None
):
if
param
:
command
=
app
+
'
'
+
param
else
:
command
=
app
try
:
child_stdout
=
os
.
popen
(
command
)
except
:
print
'
Plz relax, and let python do the job. Exiting.. :(
'
sys
.
exit
()
output
=
child_stdout
.
readlines
()
child_stdout
.
close
()
return
output
def
visit
(
arg
,
dirname
,
names
):
if
dirname
.
find
(
'
.svn
'
)
!=
-
1
:
return
if
dirname
.
endswith
(
'
LC_MESSAGES
'
):
if
'
gajim.po
'
in
names
:
path_to_po
=
os
.
path
.
join
(
dirname
,
'
gajim.po
'
)
param
=
'
--statistics
'
+
path_to_po
print
path_to_po
,
'
has:
'
get_output
(
'
msgfmt
'
,
param
)
# msgfmt doesn't use stdout?!
pos
=
path_to_po
.
find
(
'
po/
'
)
+
3
#3 = len('po/')
name
=
path_to_po
[
pos
:
pos
+
2
]
os
.
system
(
'
msgmerge -U ../po/
'
+
name
+
'
/LC_MESSAGES/gajim.po ../gajim.pot
'
)
print
name
,
'
has now:
'
os
.
system
(
'
msgfmt --statistics
'
+
path_to_po
)
if
__name__
==
'
__main__
'
:
if
len
(
sys
.
argv
)
!=
2
:
print
sys
.
argv
[
0
],
'
po_DIRECTORY
'
sys
.
exit
(
0
)
if
os
.
path
.
basename
(
os
.
getcwd
())
!=
'
scripts
'
:
print
'
run me with cwd: scripts
'
sys
.
exit
()
path_to_dir
=
sys
.
argv
[
1
]
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
)
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