modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
453 stars 165 forks source link

Add translation templates (introduced in Modelica 3.6) #4267

Open beutlich opened 6 months ago

beutlich commented 6 months ago

Now that we enabled (soft) MoLang 3.6 features, we can easily add the translation template files. Of course, they need to be updated each time before tagging a release. Therefore the strings are sorted by identifier to have it diff-friendly.

@HansOlsson @henrikt-ma Please check in Dymola and WSM, respectively, if the files are correctly generated.

beutlich commented 6 months ago

@casella Feel free to update the milestone if this is not yet considered for MSL 4.1.0. I didn't want to miss the opportunity though what's possible with new MoLang 3.6.

tobolar commented 6 months ago

Of course, they need to be updated each time before tagging a release.

Not only the original english texts shall be updated. Ideally, also all translations. (So maybe we would need "Language officers" as well. :-D )

And, in oder to populatize the multilingual feature, making public a routine for generation of pot-files from english documentation would be beneficial.

HansOlsson commented 6 months ago

I don't think we should add it for this release (possibly except the file-settings):

BTW: Dymola 2024x can generate such templates with generateTranslationFile("Modelica", "Modelica.pot"); And there's some way of reading them as well and (partially) using them - contact me if needed.

I guess we should document that more.

Additionally it is somewhat complicated to compare the files due to the sorting. I would prefer if we avoid that sorting.

I checked Complex and to me it seems as if the templates are based on an earlier version (e.g. "

c3 = sum(conj(c1[k])  c2[k] for k in 1:n)\n" from `Complex.''.scalarProduct` was missing).

beutlich commented 6 months ago

BTW: Dymola 2024x can generate such templates with generateTranslationFile("Modelica", "Modelica.pot");

Nice!

When opening the generated POT file in Poedit translation tool I get a warning on duplicate items:

grafik

tobolar commented 6 months ago

BTW: Dymola 2024x can generate such templates with generateTranslationFile("Modelica", "Modelica.pot"); And there's some way of reading them as well and (partially) using them - contact me if needed.

Nice. My first try here https://github.com/tobolar/Credibility/tree/multilingualDescriptions

beutlich commented 6 months ago

BTW: Dymola 2024x can generate such templates with generateTranslationFile("Modelica", "Modelica.pot"); And there's some way of reading them as well and (partially) using them - contact me if needed.

Nice. My first try here https://github.com/tobolar/Credibility/tree/multilingualDescriptions

Yes, that was also my assumption that both template and translations should be part of the repository.

AHaumer commented 5 months ago

Discussed this in today's MAP-Lib meeting, not realistic for 4.1.0 -> shift the milestone