RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.03k stars 178 forks source link

New convention for localizing global enums, example: gearbox modes #2839

Closed ohlidalp closed 2 years ago

ohlidalp commented 2 years ago

Extended rework of #2828

@TheDude53 Thanks for inspiring me to do this. If you want to help further, look into the "new convention" commit below and repeat the procedure for each enum in Application.h:

  1. add the ToLocalizedString(Enum e) function - thanks to function overloading in C++, the compiler will pick the correct one each time.
  2. Go through the codebase and replace all custom string conversions of that enum with the new function - except of course the helpers in AppConfig, those are for RoR.cfg only.
  3. Localize the combobox in Settings UI.
  4. Commit, one commit for each enum.

As long as this PR exists, GitHub should allow you to push directly to this branch in my repo.