Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0.H strings from experimental #75948

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

harakka
Copy link
Member

@harakka harakka commented Aug 25, 2024

Summary

None

Purpose of change

Since a lot of translation effort goes on in master instead of releases on Transifex, pull any changed strings from master and generate updated .po files.

Translation file changes are intended

Describe the solution

I wrote some TS code to do the job using smhg/gettext-parser for the .po file reading and generation. The code loads .po files from two folders, see if there's changed non-empty strings for the same context and key, and generates a new PO. The strings from master were grabbed on 2024-08-21.

Because the library doesn't preserve comment order and therefore the diffs are very hard to read, I've generated a .log file for each language for auditing the changes. This hopefully allows sufficient spot checking of the .po files.

I've eyed through a few I can at least sort of read and the process looks like it does the right thing, but I'd appreciate more eyes on this.

Describe alternatives you've considered

  • Using lang/merge_po.sh to get a more readable diff. I tried this but it moved messages around so that didn't seem like an improvement. I can still definitely do that if that's desired.

  • Leave strings as is and not do this PR

Testing

Check that compile_mo.sh can still compile the .po files, load the game with a couple of different languages and see game still works and those updated strings are there in the UI.

Additional context

Running the script:

npm run start lang_0h/lang/po lang_master/lang/po out

> [email protected] start
> tsc && node dist/main.js lang_0h/lang/po lang_master/lang/po out

da.po had total 226 contexts, 87494 keys, 2 updates, 6034 misses
fil_PH.po had total 226 contexts, 87494 keys. No changes found.
id.po had total 226 contexts, 87494 keys, 4 updates, 6034 misses
hu.po had total 228 contexts, 84429 keys. No changes found.
el.po had total 226 contexts, 87494 keys, 35 updates, 6034 misses
is.po had total 226 contexts, 87494 keys, 32 updates, 6034 misses
nl.po had total 226 contexts, 87494 keys, 4 updates, 6034 misses
tr.po had total 226 contexts, 87494 keys, 19 updates, 6034 misses
sr.po had total 226 contexts, 87494 keys, 4 updates, 6034 misses
nb.po had total 226 contexts, 87494 keys, 9 updates, 6034 misses
ro.po had total 226 contexts, 87494 keys, 3 updates, 6034 misses
cs.po had total 226 contexts, 87494 keys, 35 updates, 6034 misses
ar.po had total 226 contexts, 87494 keys. No changes found.
ga_IE.po had total 226 contexts, 87494 keys. No changes found.
it_IT.po had total 226 contexts, 87494 keys, 220 updates, 6034 misses
zh_TW.po had total 226 contexts, 87494 keys, 55 updates, 6034 misses
uk_UA.po had total 226 contexts, 87494 keys, 194 updates, 6034 misses
de.po had total 226 contexts, 87494 keys, 809 updates, 6034 misses
ko.po had total 226 contexts, 87494 keys, 4556 updates, 6034 misses
pt_BR.po had total 226 contexts, 87494 keys, 4721 updates, 6034 misses
fr.po had total 226 contexts, 87494 keys, 4201 updates, 6034 misses
pl.po had total 226 contexts, 87494 keys, 1350 updates, 6034 misses
es_AR.po had total 226 contexts, 87494 keys, 450 updates, 6034 misses
zh_CN.po had total 226 contexts, 87494 keys, 1630 updates, 6034 misses
es_ES.po had total 226 contexts, 87494 keys, 5243 updates, 6034 misses
ja.po had total 226 contexts, 87494 keys, 1846 updates, 6034 misses
ru.po had total 226 contexts, 87494 keys, 21568 updates, 6034 misses

example snippet from is.po.log:

key: "Teleport yourself"
	old: "Teleportera"
	new: "Teleportera þig"
key: "bubble wrap"
	old plurals: "kúluplast" / "kúluplast"
	new plurals: "bóluplast" / "bóluplast"

es_ES.po_log.txt
pl.po_log.txt
es_AR.po_log.txt
fr.po_log.txt
pt_BR.po_log.txt
de.po_log.txt
ko.po_log.txt
zh_TW.po_log.txt
uk_UA.po_log.txt
it_IT.po_log.txt
tr.po_log.txt
ro.po_log.txt
nb.po_log.txt
cs.po_log.txt
nl.po_log.txt
sr.po_log.txt
el.po_log.txt
is.po_log.txt
id.po_log.txt
da.po_log.txt

Copy link
Contributor

It appears you modified a .po or .pot file. These translation files are automatically generated, pushed to, and pulled from Transifex, and should not be modified otherwise. If these changes are intended, please add Translation file changes are intended to the PR body.

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Info / User Interface Game - player communication, menus, etc. astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Aug 25, 2024
@harakka harakka marked this pull request as ready for review August 25, 2024 15:35
@harakka
Copy link
Member Author

harakka commented Aug 25, 2024

Looks like there's some strings where the variables have changed, not too many so those can be backed out manually.

Never mind, looks like mismatched variables in translation strings are part for the course (ex. https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/10534852895/job/29193073744?pr=75914)

@harakka harakka marked this pull request as draft August 25, 2024 15:40
@harakka harakka marked this pull request as ready for review August 25, 2024 18:21
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 25, 2024
@dseguin dseguin merged commit 90d4b25 into CleverRaven:0.H-branch Sep 1, 2024
22 of 46 checks passed
@harakka harakka deleted the 0.H-strings-from-0.I branch October 18, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants