feat: Translations and Internationalization - #108
Conversation
|
Hi @Doncuppjr, What do you think about this PR? Is it the best way to internationalize the project? During my tests, there are still menu entries to translate. This last part might to be the hardest to implement. |
|
I've never internationalized user interaction strings before, so I can't say if it is the best. If it works it works though, and it so far as I know, it's an accepted and acceptable approach to it. Menu entries.....well, hmmmm, yeah those menu entry files don't really lend themselves towards translation. I'll think on it. |
|
For menu entry, the internationalization must add localizade string on desktop file: They might have other strings as: The logic with Instead of generate .desktop files on |
|
It was a meta data format I think that was made just for TS. In prior versions, there were like 4 different WM's available and each one could read the meta data and output the correct format for whatever wm was in use. That was a long time ago, .desktop is pretty standard these days. I don't mind doing this, but that is not a point release feature change. |
|
Possibly keep the meta data files, and generate .desktop files during build instead of runtime. That is gonna mess with pkg though.... |
|
Perhaps the best approach to ensure backward compatibility is as follows:
|
|
Sometimes there is already a .desktop, and we override it with settings in lib/menu because we want to call it through the pkg management system. Maybe a stand-by location. Render during build and then assemble/check/override the desktop database at runtime. |
|
Okay, I understand. Thank you. This remaining change is a bit complex. So I release this PR for the dialog translations and open another one for the menu entries. |
|
I think the move here, is to process /lib/menu/ files during build. The resulting .desktop files can be stored in /lib/menu and the source menu file can be removed after all entries within are processed. Can leave most of the logic in xfwm4.functions, just call functions during build and then call individual functions within to complete the conversion. At runtime, the menu can still be built, but instead of converting /lib/menu/ files, process .desktop files instead. |
- Inject translated Name/Comment/GenericName/Keywords from usr/share/applications into generated desktop entries when available - Add `source` variable support in menu files to reference an existing .desktop file for translation injection (used in pavucontrol) - Add static About.desktop with multi-language translations replacing the dynamic make_desktop call in xfwm4.functions - Add translations to xfce4-session-logout.desktop - Rename terminal menu file to xfce4-terminal for clarity - Pass menufile path to make_desktop_build and unset `source` after use
|
The new specifications have been implemented, so the menu can now be translated. I moved the generation of the .desktop file to a separate script ( There are two ways to generate the translated .desktop file:
I tested this with a few packages, and it works correctly. Some adjustments may be needed for other packages. |
🌍 Add Internationalization Support for Dialog Functions
Summary
This PR introduces comprehensive internationalization (i18n) support for Thinstation's dialog functions, enabling the system to display user interface messages in multiple languages.
Changes
🎯 Core Features
dialog.functions.poformat) for 15 languages:🔧 Technical Implementation
gettext.gitignoreto properly handle locale build artifacts📦 Package Updates
.unwind,.wind)gettextdependency to system RPMsts/build/packages/base/build/locale/Files Changed
ts/build/packages/base/etc/dialog.functions- Core translation implementation.potranslation files.unwind,.wind,.gitignore)ts/rpms/system- Added gettext dependencyTesting
The translation system has been tested with French translations. Other language files are provided as templates and can be completed by native speakers.
Benefits
.pofilesNotes