Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete/missing localization not defaulting to english #13896

Closed
2 tasks done
Regalis11 opened this issue Apr 29, 2024 Discussed in #13895 · 4 comments
Closed
2 tasks done

Incomplete/missing localization not defaulting to english #13896

Regalis11 opened this issue Apr 29, 2024 Discussed in #13895 · 4 comments
Assignees
Labels
Bug Something isn't working Code Programming task Localization

Comments

@Regalis11
Copy link
Collaborator

Discussed in #13895

Originally posted by UnhappyWithMyUsername April 29, 2024

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • 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:
<eventtext.example.c1>Oh hey look! You can tell what I'm saying because you're playing the game in english!</eventtext.example.c1>
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

@Regalis11 Regalis11 added Bug Something isn't working Code Programming task Localization labels Apr 29, 2024
@Regalis11 Regalis11 self-assigned this Apr 29, 2024
@ubertpendragon
Copy link

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
Copy link
Collaborator Author

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

@ubertpendragon
Copy link

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

oh wow

@Jasontti
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Code Programming task Localization
Projects
None yet
Development

No branches or pull requests

3 participants