|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Dynamic translation of a plug-in » » » » Post: Re: Dynamic translation of a plug-in |
Print at Dec 16, 2025, 2:30:00 PM |
| Posted by dorin at Apr 4, 2024, 8:27:48 PM |
|
Re: Dynamic translation of a plug-in Probably I'm not quite the right person to give advises here but... 1. Thanks Emmanuel for the new ExportTOSH3F plugin. I've adapted to two of my plugins which use some of the already existent menus and works very good(for me) even under v.7.2. That's means: 1.1 The plugins load under the defined menu entry without the needs of other translations in AplicationPlugin or package file in all languages. 1.2 When switch the language the plugin name and the corresponding texts inside are updated without a restart. 1.3 Until now I don't seen a reason to re-code something for this purpose. 2. That encouraged me to define (for me and my plugins) a template: 2.1 Put in the PluginAction all the things I don't want to be touched by the translators: menu entry, icon and toolbar; 2.2 Add the LanguageChangeListener class provided by Emmanuel; 2.3 Put the AplicationPlugin.properties file in the root of the plugin only with the necessary entry to plugin to work. It wont be translated. 2.4 Under the default plugin package make a new package named "locales" 2.5 In this package(folder) put all the localized files with a chooses name+(plugin acronim)+locale symbol(_fr, _it, _ru ...).properties; Mine looks like: pakageSHU_it.properties or pakageDE_de.properties. 2.6 Pay attention to set the correct path to this in plugin class. 3. For the rest of the plugins which use "Tools" as menu entry I'm still thinking. Probably I will test if TOOLS_MENU.Name exist and, if not, I will use "Tools" for all the languages. I'll see. 4. In this context my wishes: 4.1 I prefer to have an unitary translation for the "Tools" inside of HomePane class to be used by the plugins(who thinks so). 4.2 The option to add sub menu(or contextual menu) to an exiting one or to a new one. (If it wasn't programed already long time ago and I don't found it yet) ![]() ---------------------------------------- A computer program does what you tell it to do, not what you want it to do. Murphy's Law When all else fails, read the instructions. Murphy's Law If you don't like "AS IS", DIY. Dorin's law |
|
|
Current timezone is GMT Dec 16, 2025, 2:30:00 PM |