Hi Ulrich
> Well, I have set up a clean environment in my new macOS Ventura VM. I used the latest wx master for testing. I attach the i18n trace output as a text file. As can be seen from the trace log the translation catalogs were found, and no messages were issued for missing translations. However, there are still a few untranslated strings in the Window menu:
What is your info.plist telling about your supported languages ? In the internat sample you see a template for a info.plist that supports a lot of lanugages, this array will then be matched against your System’s preferred languages, best fit will win and decide in which language to translate the window menu’s entries.
Best,
Stefan
Hi Ulrich
>I built the internat sample using its unchanged Makefile. That is, the resulting info.plist contains the full list of languages from the template. My >system language is German, and that's the language that is returned by wxTranslations::GetBestTranslation() resp >wxTranslations::GetPreferredUILanguage().
>However, AFAICT GetTranslation() is not called at all for the still untranslated strings. All strings that are defined in the internat source code are >correctly translated (at least, if a translation is available in the message catalog - and that's not the case for all internat message catalogs).
Thanks for looking at this properly, I was somehow on the wrong page of the problem. The strings in the window menu are not provided by us but by the system. In menu.mm MacSetupWindowMenu we are adding our menu items, these should get translated by our translation layer
Minimize
Zoom
Bring All to Front
The other items are added by the system through the NSApp.setWindowsMenu call.
Somehow now our own items are not translated anymore … I’ll try to find out what’s happening …
Best,
Stefan
Thanks for looking at this properly, I was somehow on the wrong page of the problem. The strings in the window menu are not provided by us but by the system. In menu.mm MacSetupWindowMenu we are adding our menu items, these should get translated by our translation layer
Minimize
Zoom
Bring All to Front
The other items are added by the system through the NSApp.setWindowsMenu call.
Somehow now our own items are not translated anymore … I’ll try to find out what’s happening …
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/50123ed4-03a4-40f1-b281-3f4932ecb5cen%40googlegroups.com.
Hi Ulrich
The other items are added by the system through the NSApp.setWindowsMenu call.
Interestingly, your screenshot shows the entries "Fenster auf der linken Bildschirmseite anordnen", "Fenster auf der rechten Bildschirmseite anordnen, "Angeordnetes Fenster ersetzen" obviously in German, while on my system I see English entries "Tile Window to Left of Screen", "Tile Window to Right of Screen","Replace Tiled Window" - even though the UI language of my system is German.
Could you post the info.plist of your executable bundle ?
Best,
Stefan
Hi
> Running internat with tracing I get the following messages
20:52:13: Trace: (i18n) Using catalog "./de/wxstd.mo".
20:52:13: Trace: (i18n) string "Window" not found in context 'macOS menu name' locale ''.
20:52:13: Trace: (i18n) string "Help" not found in context 'macOS menu name' locale ''.
20:52:13: Trace: (i18n) string "Minimize" not found in context 'macOS menu item' locale ''.
20:52:13: Trace: (i18n) string "Zoom" not found in context 'macOS menu item' locale ''.
20:52:13: Trace: (i18n) string "Bring All to Front" not found in context 'macOS menu item' locale ''.
And you have copied the wxstd.mo into the sample’s language directory ? or is it there already ? as I wrote I had to do this by hand (both generating and copying) in order for things to work:
>somehow no wxstd-3.3.mo gets created, so the international sample does not have the default message catalog, when doing a msgfmt de.po ->ode.mo by hand and adding this file as a wxstd-3.3.mo to the de folder of international sample things are translated properly ...
Best,
Stefan
20:52:13: Trace: (i18n) Using catalog "./de/wxstd.mo".
20:52:13: Trace: (i18n) string "Window" not found in context 'macOS menu name' locale ''.
20:52:13: Trace: (i18n) string "Help" not found in context 'macOS menu name' locale ''.
20:52:13: Trace: (i18n) string "Minimize" not found in context 'macOS menu item' locale ''.
20:52:13: Trace: (i18n) string "Zoom" not found in context 'macOS menu item' locale ''.
20:52:13: Trace: (i18n) string "Bring All to Front" not found in context 'macOS menu item' locale ''.
And you have copied the wxstd.mo into the sample’s language directory ?
or is it there already ?
as I wrote I had to do this by hand (both generating and copying) in order for things to work:
>somehow no wxstd-3.3.mo gets created, so the international sample does not have the default message catalog, when doing a msgfmt de.po ->ode.mo by hand and adding this file as a wxstd-3.3.mo to the de folder of international sample things are translated properly ...
and the "Window" menu entry and all subentries are not translated. Actually, this is not really surprising, because only the Finnish translation catalog (locale/fi.po) was updated accordingly.
So, before this issue can be called "solved" all translation catalogs, the template "locale/wxstd.pot" and all language specific catalogs need to be updated.
Were all of the relevant strings translated for _all_ languages
in the first place, before the aforementioned commit? I doubt
that, but did not check.
Until this is done the situation is worse than before.
If you are implying that any changes in the translatable source
strings should be immediately reflected to _all_ translations,
even in the development branch, master, then I don't know if using
this Gettext-style method for wx's own translations is viable at
all.
Doing an automated update for said strings is likely to result in
some wrong terminology being used in the translations. And the
very reason for the commit to add the contexts was to try ensure
that these macOS-specific strings would get translated in a way
matching the native macOS translations, and not share translations
with other systems that might use different terminology.
Were all of the relevant strings translated for _all_ languages in the first place, before the aforementioned commit?
I doubt
that, but did not check.
If you are implying that any changes in the translatable source
strings should be immediately reflected to _all_ translations,
even in the development branch, master, then I don't know if using
this Gettext-style method for wx's own translations is viable at
all.
Doing an automated update for said strings is likely to result in some wrong terminology being used in the translations.
And the
very reason for the commit to add the contexts was to try ensure
that these macOS-specific strings would get translated in a way
matching the native macOS translations, and not share translations
with other systems that might use different terminology.
Hallo Ulrich,
Anteeksi, no offense meant.If you are implying that any changes in the translatable source strings should be immediately reflected to _all_ translations, even in the development branch, master, then I don't know if using this Gettext-style method for wx's own translations is viable at all.
No offence taken.
It is just an observation that the message catalogs need an update after such a source change. That is, wxstd.pot needs to be regenerated, so that all other language specific .po files can be updated based on it. Thereafter translators can adjust the translations, whenever they have time to do it.
IMHO ideally there would be no wxstd.pot in git at all.
It is always in risk of being outdated, as well as translations
based on it. It would be better if all translators regenerated
wxstd.pot themselves, which is not terribly hard (as you had
noticed). A daily, automatically regenerated wxstd.pot could be
made available available somewhere outside of git.
I fully understand your motivation. However, IMHO such changes should be applied to wxstd.pot first, and thereafter to individual .po files. This would make it easier for other translators to update their translations.
Any change in any translatable string would require updating wxstd.pot, which means potentially any commit. And checking the need for wxstd.pot update at each commit is not practical, unless it there is a check for that with pull requests.
Sure, the macOS menu translations are an example of some pretty prominent strings, but in general it is hard to judge when has a PR modified translatable strings significantly enough to require a .pot update and when not.
IMHO ideally there would be no wxstd.pot in git at all. It is always in risk of being outdated, as well as translations based on it. It would be better if all translators regenerated wxstd.pot themselves, which is not terribly hard (as you had noticed). A daily, automatically regenerated wxstd.pot could be made available available somewhere outside of git.
Any change in any translatable string would require updating wxstd.pot, which means potentially any commit. And checking the need for wxstd.pot update at each commit is not practical, unless it there is a check for that with pull requests.
Sure, the macOS menu translations are an example of some pretty prominent strings, but in general it is hard to judge when has a PR modified translatable strings significantly enough to require a .pot update and when not.