FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.68k stars 394 forks source link

Incomplete/missing localization not defaulting to english #13896

Closed Regalis11 closed 1 month ago

Regalis11 commented 2 months ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/13895

Originally posted by **UnhappyWithMyUsername** April 29, 2024 ### Disclaimers - [X] I have searched the issue tracker to check if the issue has already been reported. - [X] My issue happened while using mods. ### What happened? ### The problem: Any kind of text is usually defined as strings and the string calls for configured text from the localization files like english.xml, however the game only searches for the configured string in the localization the user currently has set their game to. So if a user is for example playing in russian, but our mod is not translated to russian (because we literally don't speak it), the russian players can't read the text or names of items/events/missions as it only displays raw identifiers or strings. Currently we would have to create a file for each language and copy the english content into all of them, however this causes issues for people that create and provide separate translation patches as the game then sees 2 entries for each identifier and randomly chooses between our pre-configured english text or the patch's actually translated text. ### An example: Let's imagine the following line from an english.xml is configured for a ConverstationAction of an event: `Oh hey look! You can tell what I'm saying because you're playing the game in english!` This would display as follows for everyone who plays the game in english. > "Oh hey look! You can tell what I'm saying because you're playing the game in english!" And this is how it displays for every other language: > "eventtext.example.c1" ### Solution: Make it so that if a string or identifier can't be found for any language, look for it in the english localization. If it can't be found in the english localization too, default to what's configured within the items/events/missions directly. ### Reproduction steps 1. Create an event with a conversation action. 2. Localize the event in your english.xml and reference the strings in your event's converstation action. 3. Playtest the event. Everything looks good in english. 4. Change game language to anything other than english. 5. Playtest the event again. You can't read the text. ### Bug prevalence Happens every time I play ### Single player or multiplayer? Happens in both single player and multiplayer ### - _No response_ ### Version v1.4.5.0 (Blood in the Water Update, hotfix 1) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports _No response_
ubertpendragon commented 2 months ago

The ultimate localization tool would be a console command that generates a .txt file with all the missing text identifiers in a specified language

something like findmissingtext [language]

Regalis11 commented 2 months ago

@ubertpendragon You mean the command "checkmissingloca"? :)

ubertpendragon commented 2 months ago

@ubertpendragon You mean the command "checkmissingloca"? :)

oh wow

Jasontti commented 1 month ago

Tested in: https://github.com/FakeFishGames/Barotrauma-development/pull/5262/commits/d8e28c505432f1d7541276958b053dbd267d8edd

Tested with steps provided in PR Modified it to have faulty link, Looked at different localized text, ie. components, loading screens, etc. Switched to couple different languages without restarting the game

No issues found Closing ticket as completed