Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation into other languages #4

Open
lolo76 opened this issue Sep 8, 2022 · 3 comments
Open

Translation into other languages #4

lolo76 opened this issue Sep 8, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@lolo76
Copy link

lolo76 commented Sep 8, 2022

I love Clowd, but I will love it more if it is in French.
I can help

@caesay
Copy link
Member

caesay commented Sep 8, 2022

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.

@caesay caesay added the enhancement New feature or request label Sep 8, 2022
@caesay caesay changed the title Translation Translation into other languages Nov 20, 2022
@caesay
Copy link
Member

caesay commented Nov 20, 2022

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/

@caesay caesay added the help wanted Extra attention is needed label Nov 20, 2022
@EVOTk
Copy link

EVOTk commented Dec 6, 2022

I would enjoy contributing to the French translation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants