ItsSim / fsolauncher

Official FreeSO Launcher made with Electron
https://beta.freeso.org
Mozilla Public License 2.0
14 stars 9 forks source link

[Feature] Adapt language strings to use new `strFormat` function #34

Open ItsSim opened 2 years ago

ItsSim commented 2 years ago

Is your feature request related to a problem? Please describe. In commit 4dac61ef8b3c0454397543a182b28176c0105224 I introduced a new strFormat function in a new utils.js file, located in /src/fsolauncher/library/utils.js.

I adapted one of the language strings to utilize this function (across all languages):

uitext.json:

"FSO_FAILED_INSTALLATION": "Failed to install %s. Try again later.",

macextras-installer.js

this.createProgressItem( strFormat( global.locale.FSO_FAILED_INSTALLATION, 'macOS Extras' ), 100 );

But every other language string has not been adapted yet. Here's an example that could be changed:

uitext.json

"INS_IN": "Installing in", 

... should be "Installing in %s" instead!

macextras-installer.js

this.FSOLauncher.IPC.addProgressItem(
  'FSOProgressItem' + this.id,
  `${this.parentComponent} MacExtras`,
  global.locale.INS_IN + ' ' + this.path, // should be strFormat( global.locale.INS_IN, this.path ) instead!
  Message,
  Percentage
);

Describe the solution you'd like Every language string should use string formatting if it is able to. Need to revise every string in the application.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.