Wurst7
Wurst7 copied to clipboard
Large translations update: Part 1
Description
I've noticed what Wurst have "Translations" feature, but actually the only translated values were hacks descriptions, altmanager and nochatreports strings. Almost all hack settings names and descriptions are hardcoded. I want to change it. I want move out all currently hardcoded strings into locale files to be able to fully translate Wurst for me and for future contrubutors. But it is not a trivial work. I've divided this task into 2 parts. This PR is part 1. And this is what I already did:
-
Translation keys naming scheme change I've find it illogical to name descriptions for hacks as
description.wurst.hack.<HackName>
. Let's take my PR changes as an example. If we want to get stringDEFAULT_LC
in classLocalesGenerator.Settings
, then the fully qualified name of this string will benet.wurstclient.LocalesGenerator.Settings.DEFAULT_LC
, and not theDEFAULT_LC.net.wurstclient.LocalesGenerator.Settings
. The same is applicable to hacks settings translation key names (ArrowDMG
,AutoEat
,InvWalk
). I really hope you get me right. -
LocalesGenerator.java
This is standalone program, which tracks changes in default locale file (en_us.json
) and synchronizes them among all other locale files. Specifically: (1) adds new JSON keys with default values to locale files if they were added to default locale; (2) preserves same key-value pairs sequence and same empty line positions as default locale file has; (3) moves any unknown keys to the end of locale file (with 3 empty lines indentation). -
localesGenerate
Gradle task I've written alocalesGenerate
Gradle task which will be run every Wurst build aftercompileJava
, but beforeprocessResources
to keep locale files always synchronized when implementing new hacks/features/other functions and translations to them. -
Small addings in
TranslationsOtf.java
AddedFallback to English
checkbox just to get more control about translation handling.
Second part of translations update PR will include:
- moving out all hardcoded values to locale files
- code changes if needed
- full Russian translation
- adapting and including into my PR all current PRs about locales addings or translation updates, if you'll allow
Testing
~~So far,~~ it's working as intended.