PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

Translate strings of the wizard #49

Closed plata closed 7 years ago

plata commented 7 years ago

We could use http://www.localeplanet.com/ and https://docs.transifex.com/formats/json.

plata commented 7 years ago

Maybe:

plata commented 7 years ago

Another possibility would be to call tr directly:

Packages.org.phoenicis.configuration.localisation.Localisation.tr("translation test.")

This is working but I'm not sure how we can get the text into our .pot and .po files (especially for user repositories).

qparis commented 7 years ago

Called tr directly makes more sense. The analysis of the scripts is another problem we can handle quite easily

plata commented 7 years ago

If we do that, all strings have to be in the properties file which is generated with mvn gettext:dist. I don't see how this should happen for user repositories.

qparis commented 7 years ago

The pot files should not necessarily be generated by maven. We could imagine another process that could generate all the translations from all our git repositories and uploading them to a translation platform. This is the way it is done in POLv4

plata commented 7 years ago

Sure. But that's still not enough. For example, I could provide my own scripts in a separate repository. In this case, I would not have any chance to translate those.

qparis commented 7 years ago

You could add your translation to the main repository, it should work fine

plata commented 7 years ago

Doesn't that defeat the whole point of custom repositories? I might not even want my strings to be available publicly (e.g. in a company environment). With a solution which loads a json with the translations at runtime, I could provide my own translation file for my repository.

qparis commented 7 years ago

Correct

qparis commented 7 years ago

Then we should also allow to include po files in a repository

plata commented 7 years ago

Yes.

plata commented 7 years ago

The problem with the solution from localeplanet is that it seems to do only a simple mapping. So no plural forms etc.

plata commented 7 years ago

I managed to get i18next running after changing the i18next.js a little bit. So I guess we could use that. However, there's still another problem: How do we translate the .json files?

plata commented 7 years ago

I opened a PR (PlayOnLinux/POL-POM-5#870) to solve the .json translation).

plata commented 7 years ago

Fixed.