Translation into other languages
I love Clowd, but I will love it more if it is in French. I can help
Hi, thanks for your kind comments, I am glad you like it!
Since Clowd has no support for localisation currently, we would need to decide on a localisation architecture before we can start adding translations. I will start thinking about this and look at what localisation frameworks are available for WPF.
Just leaving here a suggested implementation.
Move all hard-coded strings into a resx file, with separate keys for plurals. Example:
English:
- TimeStampDay_One {0} day
- TimeStampDay_Other {0} days
Polish (4 plural forms)
- TimestampMonth_One {0} miesiąc temu
- TimestampMonth_Few {0} miesiące temu
- TimestampMonth_Many {0} miesięcy temu
- TimestampMonth_Other {0} miesiąca temu
Ideally, we can find or create a roslyn source generator which turns this into strongly-typed functions. Example:
public class Translations
{
public string TimeStampDay(int p0);
}
For WPF we could look to generate a pre-built view model that accepts the parameters as properties and emits the strings as properties, or we could use a converter or markup extension. It's possible we can re-use some of https://github.com/rudyhuyn/PluralNet
The resx variations for other languages would be checked in to the main repo, but editing and collaboration could be done online. https://crowdin.com/ is free for open source projects, supports anonymous collaborators and branching, and supports resx natively. In terms of timelines, I don't think this feature will be worth the time investment to develop unless we already have a handful of people who are using Clowd in other languages, and would volunteer to provide / maintain translations.
If anyone is interested in this getting developed, please comment on this thread to let me know what languages you could contribute.
This is also useful: https://devblogs.microsoft.com/ifdef-windows/use-a-custom-resource-markup-extension-to-succeed-at-ui-string-globalization/
I would enjoy contributing to the French translation!