Skip to content

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Jun 25, 2025

Unable to get a definitive answer from TX, I propose we trial this once and see how it goes. It should translate four strings in grp.po, which are currently untranslated in the unused German translation.

I have set it up to allow us to run multiple patterns, digits+whitespace, directives like :pep: which occasionally appear separate and in the future I would like to see an advanced codeblock filter, copying those that do not require translation per the translation style guide.

From TX, this should work in theory:

When uploaded to Transifex, these [auto-translations by the script] will appear as “translated” in the editor, and translators will be able to filter them out, focusing on untranslated content

@StanFromIreland
Copy link
Member Author

Looking at the logs it seems to work correctly:

[library/grp.pot] Copied '0'
[library/grp.pot] Copied '1'
[library/grp.pot] Copied '2'
[library/grp.pot] Copied '3'

@rffontenelle
Copy link
Collaborator

To test this on Transifex, we can manually upload the changed POT file. Would you like to try this before moving on with review, merging etc.?

@StanFromIreland
Copy link
Member Author

Sure, do you want to do it the easy way, and just upload the file made on my system, or, upload the pot as an artefact from the workflow?

@StanFromIreland
Copy link
Member Author

Ah, it seems that there is a larger issue when tried via the web interface:

A non-empty msgstr was found on the entry with msgid '0'. Remove and try again

Which is interesting, I guess it must be different for the api, since the support staff did not mention it.

@rffontenelle
Copy link
Collaborator

I meant uploading POT file with the translation for a one-time test.

I ran your script locally (it indeed filled the msgid with the translation and then I tried to upload to Transifex via both web UI and CLI tool. Both failed with:

A non-empty msgstr was found on the entry with msgid '0'. Remove and try again

For instance, from CLI:

$ tx push -s -r python-newest.library--grp
# Getting info about resources

python-newest.library--grp - Done
[##############################] (1 / 1)

# Pushing source files

python-newest.library--grp - upload of resource 'o:python-doc:p:python-newest:r:library--grp' failed - parse_error: A non-empty msgstr was found on the entry with msgid '0'. Remove and try again
[##############################] (1 / 1)

@rffontenelle
Copy link
Collaborator

Which is interesting, I guess it must be different for the api, since the support staff did not mention it.

I bet they were talking about pushing translated msgstr from PO files, which is what the propagate_translations CI job at ci.yml does.

By the way, digits might be translated as in Japanese numerals.

@StanFromIreland
Copy link
Member Author

I think I will just do this for Polish then.

@rffontenelle
Copy link
Collaborator

rffontenelle commented Jun 25, 2025

I see many strings consisting only of a single monospaced text (wrapped in double-backquotes). These seem to be a great candidate for your script.

Thanks and sorry for not being able to implement this. Eager to see it working on pl

@StanFromIreland StanFromIreland deleted the auto-translate branch June 25, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants