Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
eb81a8ab
Commit
eb81a8ab
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Adding script to generate binary translations
parent
af2eb4f3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+3
-0
3 additions, 0 deletions
.gitignore
gen_resources.py
+1
-0
1 addition, 0 deletions
gen_resources.py
gen_translations.py
+58
-0
58 additions, 0 deletions
gen_translations.py
with
62 additions
and
0 deletions
.gitignore
+
3
−
0
View file @
eb81a8ab
...
@@ -40,5 +40,8 @@ nosetests.xml
...
@@ -40,5 +40,8 @@ nosetests.xml
# Generated files
# Generated files
src/cutecoin/gen_resources/*
src/cutecoin/gen_resources/*
src/icons_rc.py
src/icons_rc.py
src/i18n_rc.py
res/i18n/qm
res/i18n/lang-*
out
out
.directory
.directory
This diff is collapsed.
Click to expand it.
gen_resources.py
+
1
−
0
View file @
eb81a8ab
...
@@ -5,6 +5,7 @@ import sys, os, multiprocessing, subprocess
...
@@ -5,6 +5,7 @@ import sys, os, multiprocessing, subprocess
resources
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
))
resources
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
))
gen_ui
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
,
'
cutecoin
'
,
'
gen_resources
'
))
gen_ui
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
,
'
cutecoin
'
,
'
gen_resources
'
))
gen_resources
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
))
gen_resources
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
))
def
convert_ui
(
args
,
**
kwargs
):
def
convert_ui
(
args
,
**
kwargs
):
subprocess
.
call
(
args
,
**
kwargs
)
subprocess
.
call
(
args
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
gen_translations.py
0 → 100644
+
58
−
0
View file @
eb81a8ab
import
sys
,
os
,
multiprocessing
,
subprocess
,
time
gen_resources
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
))
ts
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
,
'
i18n
'
,
'
ts
'
))
qm
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
,
'
i18n
'
,
'
qm
'
))
translations
=
[]
qm_files
=
[]
qm_shortnames
=
[]
def
prepare_qm
():
for
root
,
dirs
,
files
in
os
.
walk
(
ts
):
for
f
in
files
:
if
f
.
endswith
(
'
.ts
'
):
tsfilename
=
os
.
path
.
join
(
root
,
f
)
qmshort
=
"
{0}qm
"
.
format
(
f
[:
-
2
])
qmfilename
=
os
.
path
.
join
(
qm
,
qmshort
)
srcdest
=
(
tsfilename
,
qmfilename
)
translations
.
append
(
srcdest
)
qm_shortnames
.
append
(
qmshort
)
else
:
continue
print
(
os
.
path
.
join
(
root
,
f
))
for
(
ts_file
,
qm_file
)
in
translations
:
subprocess
.
call
([
"
lrelease-qt5
"
,
ts_file
,
"
-qm
"
,
qm_file
])
print
(
ts_file
+
"
>>
"
+
qm_file
)
def
build_resources
():
files
=
""
for
file
in
qm_shortnames
:
files
+=
"""
<file alias=
"
{0}
"
>qm/{0}.qm</file>
"""
.
format
(
file
[:
-
3
])
rccfile
=
"""
<RCC>
<qresource prefix=
"
i18n
"
>{0}
</qresource>
</RCC>
"""
.
format
(
files
)
qrc_filename
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
,
'
i18n
'
,
'
langs-{0}.qrc
'
.
format
(
int
(
time
.
time
()))
))
pyc_filename
=
os
.
path
.
abspath
(
os
.
path
.
join
(
gen_resources
,
'
i18n_rc.py
'
))
with
open
(
qrc_filename
,
'
w
'
)
as
outfile
:
outfile
.
write
(
rccfile
)
try
:
subprocess
.
call
([
"
pyrcc5
"
,
"
-o
"
,
pyc_filename
,
qrc_filename
])
print
(
qrc_filename
+
"
>>
"
+
pyc_filename
)
finally
:
os
.
remove
(
qrc_filename
)
prepare_qm
()
build_resources
()
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