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
3e80707e
Commit
3e80707e
authored
7 years ago
by
André
Browse files
Options
Downloads
Patches
Plain Diff
setup.py: add update_po command
parent
864e5725
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
setup.py
+43
-0
43 additions, 0 deletions
setup.py
with
44 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
3e80707e
...
...
@@ -12,6 +12,7 @@ data/org.gajim.Gajim.appdata.xml
data/org.gajim.Gajim.desktop
libtool
po/.intltool-merge-cache
po/gajim.pot
po/POTFILES
po/stamp-it
stamp-h1
...
...
This diff is collapsed.
Click to expand it.
setup.py
100755 → 100644
+
43
−
0
View file @
3e80707e
...
...
@@ -20,6 +20,35 @@ pos = [x for x in os.listdir('po') if x[-3:] == ".po"]
ALL_LINGUAS
=
sorted
([
os
.
path
.
split
(
x
)[
-
1
][:
-
3
]
for
x
in
pos
])
cwd
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
def
update_trans
():
'''
Update translation files
'''
template
=
os
.
path
.
join
(
'
po
'
,
'
gajim.pot
'
)
files
=
[
os
.
path
.
join
(
root
,
f
)
for
root
,
d
,
files
in
os
.
walk
(
'
gajim
'
)
for
f
in
files
if
os
.
path
.
isfile
(
os
.
path
.
join
(
root
,
f
))
and
(
f
.
endswith
(
'
.py
'
)
or
f
.
endswith
(
'
.ui
'
))]
files
.
append
(
os
.
path
.
join
(
"
data
"
,
"
gajim-remote.desktop.in
"
))
files
.
append
(
os
.
path
.
join
(
"
data
"
,
"
org.gajim.Gajim.desktop.in
"
))
files
.
append
(
os
.
path
.
join
(
"
data
"
,
"
org.gajim.Gajim.appdata.xml.in
"
))
cmd
=
'
xgettext --from-code=utf-8 -o %s %s
'
%
(
template
,
"
"
.
join
(
files
))
if
os
.
system
(
cmd
)
!=
0
:
msg
=
"
ERROR: %s could not be created!
\n
"
%
template
raise
SystemExit
(
msg
)
for
lang
in
ALL_LINGUAS
:
po_file
=
os
.
path
.
join
(
'
po
'
,
lang
+
'
.po
'
)
cmd
=
'
msgmerge -U %s %s
'
%
(
po_file
,
template
)
if
os
.
system
(
cmd
)
!=
0
:
msg
=
'
ERROR: Updating language translation file failed.
'
ask
=
msg
+
'
\n
Continue updating y/n [n]
'
reply
=
input
(
ask
)
if
reply
in
[
'
n
'
,
'
N
'
]:
raise
SystemExit
(
msg
)
log
.
info
(
'
Updating %s
'
,
po_file
)
def
build_trans
(
build_cmd
):
'''
Translate the language files into gajim.mo
...
...
@@ -157,6 +186,19 @@ class test_nogui(test):
def
run
(
self
):
os
.
system
(
"
./test/runtests.py -n
"
)
class
update_po
(
Command
):
description
=
"
Update po files
"
user_options
=
[]
def
initialize_options
(
self
):
pass
def
finalize_options
(
self
):
pass
def
run
(
self
):
update_trans
()
package_data_activities
=
[
'
data/activities/*/*/*.png
'
]
package_data_emoticons
=
[
'
data/emoticons/*/emoticons_theme.py
'
,
...
...
@@ -209,6 +251,7 @@ setup(
'
build_py
'
:
build
,
'
test
'
:
test
,
'
test_nogui
'
:
test_nogui
,
'
update_po
'
:
update_po
,
},
scripts
=
[
'
scripts/gajim
'
,
...
...
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