DISMTools icon indicating copy to clipboard operation
DISMTools copied to clipboard

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

Open htcfreek opened this issue 1 year ago • 4 comments

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

htcfreek avatar Jul 07 '24 22:07 htcfreek

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)

CodingWonders avatar Jul 08 '24 09:07 CodingWonders

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.

htcfreek avatar Jul 08 '24 09:07 htcfreek

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

CodingWonders avatar Jul 08 '24 09:07 CodingWonders

@htcfreek, after thinking about it, this will be the definitive plan. ResX files will not be used, but INI files (see #112 for more info.)

This parser library is being used for HotInstall to have something to experiment with with the library.

Image Image

The implementation used to read the sections is simple and effective and is planned to be used in a future version of DISMTools.

CodingWonders avatar Jan 27 '25 18:01 CodingWonders