Page MenuHomeWildfire Games

Port Transifex scripts to Python 3
AbandonedPublic

Authored by Phormio on May 16 2017, 9:44 AM.

Details

Summary

Transifex Client now supports Python 3.5 in addition to Python 2.7:
https://ci.appveyor.com/project/transifex/transifex-client/branch/master

The script './pullTranslations.py' is now compatible with Python 3 as well as Python 2.

Test Plan

Not applicable.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Phormio created this revision.May 16 2017, 9:44 AM
Phormio edited the summary of this revision. (Show Details)May 16 2017, 9:55 AM
Phormio edited the summary of this revision. (Show Details)
vladislavbelov requested changes to this revision.May 16 2017, 3:48 PM
vladislavbelov added a subscriber: vladislavbelov.
vladislavbelov added inline comments.
source/tools/i18n/pullTranslations.py
33 ↗(On Diff #1966)

If you move, you need to exit if it's incompatible version, like:

if sys.version_info[0] != 3:
This revision now requires changes to proceed.May 16 2017, 3:48 PM
leper added inline comments.May 16 2017, 7:38 PM
source/tools/i18n/maintenanceTasks.sh
36 ↗(On Diff #1966)

If we move one of these, why not the other too?

Also these blank lines help with splitting things into sections, I'd keep them.

source/tools/i18n/pullTranslations.py
49 ↗(On Diff #1966)

Why not just hide this behind a version check? Unless we are moving to python 3 exclusively.

Phormio updated this revision to Diff 1984.May 16 2017, 9:27 PM
Phormio edited edge metadata.
Phormio edited the summary of this revision. (Show Details)
  • pullTranslations.py script is now compatible with both Python 2 and Python 3
vladislavbelov added inline comments.May 18 2017, 3:46 PM
./source/tools/i18n/maintenanceTasks.sh
36

Why 2 was removed only from a line below? Why not here?

Phormio added inline comments.May 18 2017, 5:15 PM
./source/tools/i18n/maintenanceTasks.sh
36

Because it's a Python 2 script that I didn't check for compatibility. If you care, do it yourself -- I have other differentials upcoming that are more important.

vladislavbelov added inline comments.May 18 2017, 5:22 PM
./source/tools/i18n/maintenanceTasks.sh
36

Then it's not good way to port, because now you need to have 2 versions of Python instead of 1, so I don't see profits in this case. Scripts work with python2 too.

Phormio added inline comments.May 21 2017, 3:28 PM
./source/tools/i18n/maintenanceTasks.sh
36

Porting all of 0.A.D. to Python 3 isn't something I can attempt (yet), my knowledge is too poor for even an effort estimate. But at least now the script I patched works for both Python 3 and Python 2 now, so that's not a concern for this differential any more.

leper requested changes to this revision.May 29 2017, 7:42 PM
leper added a reviewer: Itms.

Might be ok without the shell script changes.

Handing this to Itms since he's IIRC responsible for the translation update box.

This revision now requires changes to proceed.May 29 2017, 7:42 PM
bb added a subscriber: bb.Oct 13 2020, 7:02 PM
bb added inline comments.
./source/tools/i18n/maintenanceTasks.sh
36

updateTemplates depends on pology which still is python2, though there is some outdated branch lifting that to python3 https://github.com/KDE/pology/tree/python3. Could try using that upstream, but likely another patch

41

Not sure if we should support old (which are being nuked everywhere) or newer (not existing yet) versions. Maybe forcing python3 is good enough.

wraitii abandoned this revision.Dec 2 2020, 11:06 AM
wraitii added a subscriber: wraitii.

Irrelevant following D2757 / rP24313