Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GCompris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
27
Issues
27
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
GCompris
Commits
5b277b5d
Commit
5b277b5d
authored
Mar 21, 2020
by
Johnny Jazeix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core, remove all python2 occurences
parent
69a32fc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
CMakeLists.txt
CMakeLists.txt
+2
-2
tools/convertPoToTsFiles/mergePo.py
tools/convertPoToTsFiles/mergePo.py
+3
-3
tools/l10n-fetch-po-files.py
tools/l10n-fetch-po-files.py
+7
-6
No files found.
CMakeLists.txt
View file @
5b277b5d
...
...
@@ -208,7 +208,7 @@ include(cmake/rcc.cmake)
# Simple command calling the python script
add_custom_command
(
OUTPUT retrievePoFilesFromSvn
COMMAND python
2
tools/l10n-fetch-po-files.py
COMMAND python tools/l10n-fetch-po-files.py
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
# Install translations
...
...
@@ -217,7 +217,7 @@ add_custom_target(getSvnTranslations
COMMENT
"Re-run cmake after this to be able to run BuildTranslations with the latest files"
)
# Get all po files in po/. You can get them doing: python
2
tools/l10n-fetch-po-files.py
# Get all po files in po/. You can get them doing: python tools/l10n-fetch-po-files.py
file
(
GLOB TRANSLATIONS_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"po/*.po"
)
# Set the output dir for the translation files to /bin
foreach
(
PoSource
${
TRANSLATIONS_FILES
}
)
...
...
tools/convertPoToTsFiles/mergePo.py
View file @
5b277b5d
#!/usr/bin/python
2
#!/usr/bin/python
#
# GCompris - mergePo.py
#
...
...
@@ -19,12 +19,12 @@
# Using polib.py from https://bitbucket.org/izi/polib/wiki/Home
# Usage : python
2
mergePo.py qt.po gtk.po
# Usage : python mergePo.py qt.po gtk.po
# Find in the first argument po file the translated lines of the gtk po file
# (if existing) and replace the translation for the po file.
# For those not found, no translation is provided.
# something like: python
2
mergePo.py gcompris_fi.po fi.po && sed '/^#|/ d' < gcompris_fi.po > qtgl.po && mv qtgl.po gcompris_fi.po
# something like: python mergePo.py gcompris_fi.po fi.po && sed '/^#|/ d' < gcompris_fi.po > qtgl.po && mv qtgl.po gcompris_fi.po
import
sys
import
polib
...
...
tools/l10n-fetch-po-files.py
View file @
5b277b5d
...
...
@@ -43,13 +43,13 @@ if not os.path.exists(OUTPUT_PO_PATH):
all_languages
=
subprocess
.
check_output
([
'svn'
,
'cat'
,
SVN_PATH
+
'subdirs'
],
stderr
=
subprocess
.
STDOUT
)
all_languages
=
[
x
.
strip
()
for
x
in
all_languages
.
split
(
"
\n
"
)
if
len
(
x
)]
all_languages
=
[
x
.
strip
()
for
x
in
all_languages
.
decode
().
split
(
"
\n
"
)
if
len
(
x
)]
all_languages
.
remove
(
"x-test"
)
for
lang
in
all_languages
:
try
:
raw_data
=
subprocess
.
check_output
([
'svn'
,
'cat'
,
SVN_PATH
+
lang
+
SOURCE_PO_PATH
],
stderr
=
subprocess
.
PIPE
)
(
transformed
,
subs
)
=
fixer
.
subn
(
'# ~| '
,
raw_data
)
(
transformed
,
subs
)
=
fixer
.
subn
(
'# ~| '
,
raw_data
.
decode
()
)
pos1
=
re_empty_msgid
.
search
(
transformed
).
start
()
pos2
=
re_empty_line
.
search
(
transformed
).
start
()
if
re_has_qt_contexts
.
search
(
transformed
,
pos1
,
pos2
)
is
None
:
...
...
@@ -58,12 +58,13 @@ for lang in all_languages:
transformed
[
pos2
:]
subs
=
subs
+
1
if
(
subs
>
0
):
print
"Fetched %s (and performed %d cleanups)"
%
(
lang
,
subs
)
print
(
"Fetched %s (and performed %d cleanups)"
%
(
lang
,
subs
)
)
else
:
print
"Fetched %s"
%
lang
file
(
OUTPUT_PO_PATH
+
OUTPUT_PO_PATTERN
%
lang
,
"wb"
).
write
(
transformed
)
print
(
"Fetched %s"
%
lang
)
out_file
=
open
(
OUTPUT_PO_PATH
+
OUTPUT_PO_PATTERN
%
lang
,
"wb"
)
out_file
.
write
(
transformed
.
encode
())
except
subprocess
.
CalledProcessError
:
print
"No data for %s"
%
lang
print
(
"No data for %s"
%
lang
)
# Inform qmake about the updated file list
#os.utime("CMakeLists.txt", None)
...
...
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