Sonya* Posted April 5, 2021 Posted April 5, 2021 I have some non-English projects, where I have made some changes to the language strings. These changes should be permanent. There is also a language pack in Marketplace. When I upgrade the project, I have to make many steps to keep my custom translations. This is how I do it: Download the custom language as XML (Custom package) Download Marketplace package as XML (Marketplace package) Copy Marketplace package (Merged package) Upload a new version (Custom package) on Merged package Change the name of the package back to Merged Set Merged package as Default Disable other language packages When I'd like to change some strings in my project, I have to go this way Make changes in my Custom package Download Custom package as XML Upload a new version (Custom package) on Merged package Change the name of the package back to Merged When there is an upgrade for Marketplace package: Upgrade Marketplace package Download Marketplace package as XML (Marketplace package) Upload a new version (Marketplace package) on Merged package Upload a new version (Custom package) on Merged package Change the name of the package back to Merged This is quite time-consuming. I wish parent/child construction (like themes), where my custom changes just overload the Marketplace package. Additionally, a filter where I can see what translations differ from parent version. This would help to prevent all these steps above, keep my custom translations and still use Marketplace updates without loosing my custom changes. Unienc, Ilya Hoilik, Askancy and 2 others 3 2
CoffeeCake Posted April 5, 2021 Posted April 5, 2021 Just a note that this helps with fully English projects as well. We often use different phrases and words for built in features and use the translation/language tool to maintain this. Sonya* 1
Sonya* Posted April 5, 2021 Author Posted April 5, 2021 (edited) 9 minutes ago, CoffeeCake said: Just a note that this helps with fully English projects as well. We often use different phrases and words for built in features and use the translation/language tool to maintain this. Yes, the best example are Clubs. Some communities keep Clubs, others want Groups, there are also Guilds or Teams. Changing those strings makes you actually non-upgradable. All new strings go to default language, and you have to update your custom language somehow manually. Edited April 5, 2021 by Sonya*
Daniel F Posted April 5, 2021 Posted April 5, 2021 Have you tried creating a plugin to replace every langstring containing clubs with e.g. guilds just before the strings are returned?
Sonya* Posted April 5, 2021 Author Posted April 5, 2021 Just now, Daniel F said: Have you tried creating a plugin to replace every langstring containing clubs with e.g. guilds just before the strings are returned? No. This was just an example for English usage. 🙂 For my case, I need something to upgrade my Russian and German projects more efficiently 😉
Daniel F Posted April 5, 2021 Posted April 5, 2021 There's a similar suggestion topic and once again.. we're aware of many issues and limitations with the current language system, but it's just a too huge change and I don't expect that we'll start such a reactoring while the IPS 4.x lifecycle. That said=> 36 minutes ago, Sonya* said: I need something to upgrade my Russian and German projects more efficiently 😉 That's exactly what I'm talking about:) A hook on Lang::replaceWords with something like array_walk_recursive($this->words, function(&$i,$key) use ( $searchAndReplace ) { $i = strtr( $i, $searchAndReplace ); }); will do literally all the work for you;) Unfortunatly I'm lacking the time to create a proper MP compatible app for this, but it's really not that hard. A database table + node model + controller to manage the replacements, store them to the Datastore to save the global query, run replacement at the end, BOOM DONE!
Sonya* Posted April 5, 2021 Author Posted April 5, 2021 @Daniel, how would you replace this in German? Dem Club beigetreten, in den Club eingeladen, im Club gepostet and so on... 😉
Recommended Posts