tannerhelland / PhotoDemon

A free portable photo editor focused on pro-grade features, high performance, and maximum usability.
https://photodemon.org
Other
1.3k stars 192 forks source link

How to translate the same menu name into different words #491

Closed Charltsing closed 9 months ago

Charltsing commented 9 months ago

Select menu --> Invert , Translat in Simplified Chinese --> 反选 Adjustments --> Invert , Translat in Simplified Chinese --> 反相

Invert --> 反选 or 反相

tannerhelland commented 9 months ago

Thank you for raising this issue, @Charltsing .

There is no way to do this right now, but I am working on a solution. I will report back soon with a fix for translating the same menu into different words.

tannerhelland commented 9 months ago

A fix for this issue is now available.

PhotoDemon language files now support language translations by menu ID instead of menu caption. This new feature requires an optional section at the end of a language file. I have already added one to your latest Simplified Chinese file. It looks like this (scroll to the bottom of the file):

<special-translations>

<object-id>select_invert</object-id>
<translation>(Select - Invert translation here)</translation>

<object-id>adj_invert</object-id>
<translation>(Adjustments - Invert translation here)</translation>

</special-translations>

You can see the object IDs for individual PhotoDemon menus in this source code file:

https://github.com/tannerhelland/PhotoDemon/blob/main/Modules/Menus.bas#L158

Each menu's unique ID is the second item following each AddMenuItem line. (The first item is the English caption.)

I can also produce unique object IDs for other text in the program. Please let me know if there are other places where the English text cannot be reused directly for Chinese text, and I can add more object IDs to the translation file.

Thank you again for raising this issue. Please also respond to my question at #490 if you can, so I can properly credit your work.

Thank you!

Charltsing commented 9 months ago

i found another issus

UpdateEngine.bas buildStateString = "alpha" , alpha Translat in Simplified Chinese --> 内测版

Layerpanel_Layers Caption = "alpha:" , alpha Translat in Simplified Chinese --> 透明

how to fix for this issue?

Charltsing commented 9 months ago

Simplified_Chinese-20230930.zip

update Huge amount phrases

Charltsing commented 9 months ago

Dialog_OutlineSettings.frm solid --> 实线

Dialog_FillSettings.frm solid --> 纯色

tannerhelland commented 9 months ago

Thank you for your ongoing help, @Charltsing . I have merged all of your submitted changes into a new nightly build, and I have added support for the translations listed above in this thread. I have also added you to the contributor list in the Help > About menu (and the corresponding AUTHORS.md file here at GitHub).

I will close this issue for now. Thank you again for your great contributions, and please let me know if you encounter any other localization problems with the software.