CodingWonders / DISMTools

The connected place for Windows system administration
GNU General Public License v3.0
315 stars 12 forks source link

[FEATURE PROPOSAL] Make translation easier by moving all strings to a json, ini or resx/resw file #141

Open htcfreek opened 1 month ago

htcfreek commented 1 month ago

Is your feature request related to a problem?

No, not related to a problem. But finding all the strings in the code is complicated.

Describe the solution you'd like

A set of external files (one per language) that contains the strings and some additional metadata (translators, is RTL language, language name and language id).

As file type ini, json or resx/resw might be good.

All places that require a translated string call a function that does the following:

  1. Check if a language file exist for the current Windows Ui language.
    • If yes: Use it.
    • If no: Fall back to English.
  2. Check the language file for the translated string.
    • If exists: Use it.
    • If not exists: Fall back to English.

Describe alternatives you've considered

Additional context

CodingWonders commented 1 month ago

This looks like a good enhancement. I'm currently working on adding stub preferences for AppX packages but, meanwhile, I'm also looking at how other projects do that (since I know nothing about localization with RESX files)

htcfreek commented 1 month ago

This looks like a good enhancement. I'm currently working on adding stub preferences for AppX packages but, meanwhile, I'm also looking at how other projects do that (since I know nothing about localization with RESX files)

An AutoIt project (WhyNotWin11 from RCMahel) uses ini files.

Fir resx examples you might look at PowerToys or Window Terminal from Microsoft.

CodingWonders commented 1 month ago

I think I'll go with ResX files for this since it is "the .NET way". Currently, I'm looking at how ShareX does it, and I think it's going to be easy