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 Simplified Chinese Translation #514

Merged
merged 4 commits into from
May 10, 2024
Merged

Conversation

UM-Li
Copy link
Contributor

@UM-Li UM-Li commented May 4, 2024

  • Corrected the alt-menu entries so that they work properly.
  • Translated strings newly added since last time.

@UM-Li UM-Li marked this pull request as draft May 4, 2024 08:51
@UM-Li UM-Li marked this pull request as ready for review May 4, 2024 09:09
@UM-Li
Copy link
Contributor Author

UM-Li commented May 4, 2024

Oops I ran scripts/create-locales.sh to update zh_CN.po, but it seems other POT files were also somehow changed... I'm not sure if this may break something; if necessary I'll reopen this PR.

@lah7 lah7 added the i18n Localization support label May 4, 2024
lah7 pushed a commit to UM-Li/polychromatic that referenced this pull request May 4, 2024
Copy link
Member

@lah7 lah7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢 (Thank you!)

No problem about the other POT/PO files. For cleanness, I've taken them out of this pull request (to only show zh_CN.po changes) and squashed your two commits into one. Here's a trick for next time:

git add locale/zh_CN.po
git commit -m "Update Simplified Chinese Translation"

@lah7
Copy link
Member

lah7 commented May 4, 2024

In polychromatic-controller, do the translations appear as expected in your locale?

For me (in any other language), passing --locale still shows English in some places. I think .ui files are not translated properly, but it might something to do with the recent update (just related observation, not a fault with your work!). Maybe it works if the system is fully configured to that locale. I'll do some investigation and either fix that parameter or update the documentation.

@UM-Li
Copy link
Contributor Author

UM-Li commented May 4, 2024

Hi @lah7, some strings do not show their translation here either (mine is a fully zh_CN.UTF-8 environment). For now all entries in zh_CN.po have been translated, so it does seem like something with the source code. There are occurrences of this in both the controller and the tray app:

屏幕截图_20240504_194824
屏幕截图_20240504_194926
屏幕截图_20240504_195009
屏幕截图_20240504_195017

@lah7
Copy link
Member

lah7 commented May 8, 2024

Thanks for the info! There were a few bugs with how translations were processed, which have been fixed. These were mainly regressions from the v0.9.0 release.

Would you be happy to pull the latest changes and check your translation? There will be new strings for the tray applet and CLI interfaces too (./scripts/create-locales.sh)

After the translation is up-to-date, I'll look at publishing a new release.

@UM-Li
Copy link
Contributor Author

UM-Li commented May 9, 2024

Hi, just finished translating the new strings and tested with devices I have. Translations for the controller and tray app seem good, but the cli app has a place where wide characters may overlap. As far as I see strings no. 341-44 may be affected, polychromatic-cli lines 380-391.

屏幕截图_20240509_150734

lah7 added a commit that referenced this pull request May 9, 2024
@lah7
Copy link
Member

lah7 commented May 9, 2024

Thanks, great job! 👍🏼

I made some attempts locally to try and accommodate the wider characters using code, but I didn't feel satisfied with the result without impacting other languages (mostly it ends up too wide in --help). I can see the problem, as far as the code is concerned, it's seen as 3 characters, but the terminal renders them wider. There is a calculation (print_columns) to move the cursor so it looks like a table.

123
...
VID
序列号  
^^^

This is what I was experimenting with → 30efc7e. I am wondering about discontinuing the CLI interface in future, so we shouldn't spend too long on this.

For now, the simplest solution seems to be adding additional spaces at the end of the translated string for this affected area. What do you think?

#: polychromatic-cli:385 polychromatic-cli:388 polychromatic-cli:391
#: polychromatic/controller/devices.py:933
msgid "Custom Effects"
-msgstr "自定义灯效"
+msgstr "自定义灯效    "

image

@UM-Li
Copy link
Contributor Author

UM-Li commented May 9, 2024

Yes, tested in my environment too and this works 👍

@lah7 lah7 merged commit 272786e into polychromatic:master May 10, 2024
2 checks passed
lah7 pushed a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Localization support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants