Skip to content

ENH: update PO and POT files by a script#7230

Merged
peircej merged 4 commits intopsychopy:devfrom
hsogo:feature-translation-alert
May 7, 2025
Merged

ENH: update PO and POT files by a script#7230
peircej merged 4 commits intopsychopy:devfrom
hsogo:feature-translation-alert

Conversation

@hsogo
Copy link
Copy Markdown
Contributor

@hsogo hsogo commented May 7, 2025

generateTranslationTemplates.py was modified to updates PO files in addition to POT file.
With -c option, the script makes a commit if any files are updated.
Please see also #7206.

Quesition:

  • The script commits the changes with a title of "ENH: Translation template is updated" (see afc0f4d for example: this commit was made by the script). "ENH" category is appropriate?
  • The script updates Project-Id-Version (PsychoPy version is stored) and POT-Creation-Date of all PO files. Is it Ok? Are there other metadata that should be updated?

hsogo added 4 commits April 28, 2025 20:39
Number of messages in *.py files: 2180
New message(s): 265

Untranslated message(s)
  ar_001:     799 ( 36.7%)
  cs_CZ:       0 (  0.0%)
  da_DK:       0 (  0.0%)
  de_DE:     274 ( 12.6%)
  el_GR:       0 (  0.0%)
  en_NZ:       0 (  0.0%)
  en_US:       0 (  0.0%)
  es_CO:    1788 ( 82.0%)
  es_ES:    1787 ( 82.0%)
  es_US:    1788 ( 82.0%)
  et_EE:      13 (  0.6%)
  fa_IR:       5 (  0.2%)
  fi_FI:       0 (  0.0%)
  fr_FR:     223 ( 10.2%)
  he_IL:       1 (  0.0%)
  hi_IN:       0 (  0.0%)
  hu_HU:       0 (  0.0%)
  it_IT:       1 (  0.0%)
  ja_JP:    2176 ( 99.8%)
  ko_KR:       0 (  0.0%)
  ms_MY:      10 (  0.5%)
  nl_NL:       0 (  0.0%)
  nn_NO:       0 (  0.0%)
  pl_PL:       0 (  0.0%)
  pt_PT:    1801 ( 82.6%)
  ro_RO:       0 (  0.0%)
  ru_RU:       0 (  0.0%)
  sv_SE:       0 (  0.0%)
  tr_TR:       1 (  0.0%)
  zh_CN:    1242 ( 57.0%)
  zh_TW:     662 ( 30.4%)
@codecov
Copy link
Copy Markdown

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 121 lines in your changes missing coverage. Please review.

Project coverage is 12.27%. Comparing base (9433466) to head (d000ea1).
Report is 46 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7230      +/-   ##
==========================================
- Coverage   12.28%   12.27%   -0.01%     
==========================================
  Files         346      346              
  Lines       64066    64115      +49     
==========================================
  Hits         7870     7870              
- Misses      56196    56245      +49     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@peircej peircej merged commit 26540c6 into psychopy:dev May 7, 2025
7 checks passed
@peircej
Copy link
Copy Markdown
Member

peircej commented May 7, 2025

oh @hsogo can your script change the wrap width to 79? It used the babel default of 76, by the looks, but because poedit defaults to 79 it means a lot of the apparent changes in the git file are actually just re-wraps.

@hsogo
Copy link
Copy Markdown
Contributor Author

hsogo commented May 9, 2025

@peircej
I modifed the scripts to set wrap width 79. Since this pull request has been closed, do I need to make a new pull request?

By the way, in my environment (Windows11, Poedit free version 3.6.1, "wrap at:"=79), text is not wrapped even if "wrap at:" option is set in Poedit. For example, a long sentence in messages.po generated by my script is wrapped as following:

#: ../app/connections/updates.py:344
#, python-format
msgid ""
"You are running PsychoPy (%(running)s), which is ahead of the latest official"
" version (%(latest)s)"
msgstr "PsychoPy %(running)s を実行中です 公式の最新バージョン(%(latest)s)より新しいバージョンです"

After editing this messages.po with Poedit, this entry is not wrapped as following:

#: ../app/connections/updates.py:344
#, python-format
msgid "You are running PsychoPy (%(running)s), which is ahead of the latest official version (%(latest)s)"
msgstr "PsychoPy %(running)s を実行中です 公式の最新バージョン(%(latest)s)より新しいバージョンです"

EDITED at 2025/07/09
I wrote that the "Preserve formatting of existing files" option of the Poedit might be involved, but I'm not sure the exact solution at this time.

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