mtkennerly / ludusavi-playnite

Playnite plugin for save backups via Ludusavi
MIT License
141 stars 9 forks source link

Add localizations support #34

Closed darklinkpower closed 2 years ago

darklinkpower commented 2 years ago

If I'm not wrong the extension has its own system for localization, but as a suggestion I would recommend to use the builtin system for extensions in Playnite:

Documentations: https://playnite.link/docs/master/tutorials/extensions/localizations.html?tabs=csharp

This way you can use something like Crowdin to provide an easy way to edit and update them and also have the string available in the plugin code and in xaml views and resources

An example of a configuration file for Crowdin to automatically pick localization files: https://github.com/darklinkpower/PlayniteExtensionsCollection/blob/master/crowdin.yml

mtkennerly commented 2 years ago

I have some concerns with the builtin system that have kept me from using it:

Something like Project Fluent solves the first issue, although it still has the third issue.

darklinkpower commented 2 years ago
  1. Personally I don't think it should be an issue. Localization should be done by someone who knows the base language, english in this case, and localize it in a way that works in the target language. I've done the localization for Playnite and different Playnite extensions projects into spanish and I've ran into this issue a lot of times but I've made decisions to decide what works best for the localization. But even then, I've little experience in this and this situation may be worse for other languages
  2. Yeah unfortunately it's a limitation but it can be fixed by just adding the extension name as a prefix, for example: https://github.com/darklinkpower/PlayniteExtensionsCollection/blob/b29e507ae26e2266e310c62869a0f5663ca39473/source/Generic/PlayState/Localization/en_US.xaml#L1-L5
  3. This is one of the main reasons why I'm suggesting to use the provided localizations system. Using dictionary files allows you to use something like Crowdin that provided a very easy way for anyone without coding experience to contribute localizations. Crowdin also takes care of making automatic PRs that updates new localizations and add new strings to the different language files. Example: https://github.com/darklinkpower/PlayniteExtensionsCollection/pull/251/files But I'm not familiar with Project Fluent, I'll take a look as it may have a similar system that does this or there may be one out there that does this
mtkennerly commented 2 years ago

Oh, it looks like Crowdin actually supports Project Fluent (source), and there are a couple of .NET implementations (Fluent.Net, Linguini). I'll give it a shot, since it addresses two of my three concerns.

mtkennerly commented 2 years ago

Both Ludusavi and the plugin are now on Crowdin and using Project Fluent for translation files:

I'll try to get a plugin release out within the next few days with the latest changes.