Jump to content

The issue with '$' in UI strings and a couple of ideas on how to go about trying to resolve it


Surilindur

Recommended Posts

Edit: See these ones, from people who actually know things, for actual information, they will help you, unlike my misinformed speculations:

 

 

 

 

Disclaimer

 

First of all, I am by no means an expert on the matter, nor am I in any capacity affiliated with the SkyUI team or any other authority on the matter. Anything contained in this post is based solely on my own observations of the issue, and it might or might not truthfully reflect the reality of the issue. The reader should therefore understand that any solutions presented here might or might not work, due to being based on information that can potentially be completely false and utterly misleading. Please, take this with an abolutely overwhelming grain of salt. As with anything on the Internet, the use of common sense is preferred, and should someone happen to have a more complete and/or truthful understanding of the issue, feel free to educate me. And in case there are any mistakes, no matter how small or insignificant they may seem, please, do point them out. Thank you.

 

 

Motivation

 

There seem to be threads created here, in the Skyrim section of The Nexus Forums, on a somewhat regular basis, about the issue in which dollar signs appear in UI strings. One of the most commonly suggested measures to resolve the issue seem to be to reinstall the affected mod or to verify game cache. While this usually should work, it does not necessarily always help everyone, and since the information about the actual causes of the issue is not exactly posted everywhere (at least not anywhere I would have spotted it), I thought it would be nice to write a small explanation with both the common reasons behind the issue and a couple of ideas on how to potentially go about fixing it.

 

 

The issue

 

The issue in question involves - or actually is, depending on how one wishes to view it - the presence of dollar signs, as in, '$' symbols, in front of UI strings. That is, pieces of text in the user interface having that dollar sign as a prefix. While it does not cause any issues by itself, it does look a bit odd, and is certainly not intended.

 

Some images to illustrate the issue, by the user phazon123, who started the Dollar Sign Before Text thread here on The Nexus Forums. I will replace them later with my own ones when I have access to my desktop again (this laptop chokes on Oblivion so Skyrim is out of question):

 

 


http://i.imgur.com/l8NVd.jpg
http://i.imgur.com/bdmhz.jpg

 

 

The issue can affect both the base game Skyrim and the MCM menus created by the framework offered by the incredible SkyUI. Most likely the MCM menus, though. But they can both be fixed.

 

In the following wall of text (sorry), I am pathetically trying to:

  • explain, on an idiot level (from my own part, that is, the idiot level...) how string localisation could approximately work, and where those dollar signs could come from, when using enough speculation and imagination
  • explain why the base game, as in, the main menu and others, can have issues with loading the localisations, most likely resulting in those dollar signs
  • explain how to potentially go about fixing the base game dollar signs
  • continuing from the base game localisation, explain why some MCM menus can have those dollar signs, too
  • explain how to go about investigating the MCM translation issues

So it is all really just me rambling mindlessly, hoping for someone to correct any mistakes I make in the process. Whoops.

 

 

Too long wall of text! Not going to read!

 

Yes, I know, I just cannot explain things properly. :facepalm: See here, it has everything you need in a much more condensed space: https://github.com/schlangster/skyui/wiki/MCM-Advanced-Features#Localization

 

 

Base game strings

 

Skyrim supports a number of languages, so all the UI strings need to support those different languages, too. That is, the text in the main menu, in the pause menu and the like: those who play in English will see strings like "continue", "load", "save", "settings", "jump" and the like, whereas those who play in French or German, for example, will see strings that match their languages. Why and how does it do that - display different strings to different language versions? Where does the game keep record of the user's language? Maybe in Skyrim.ini file, in the General section:

[GENERAL]
sLanguage=ENGLISH

But how could the game show text in different languages on the same UI elements, for so many languages? For illustrative purposes, one could, perhaps, imagine how Skyrim UI could have some common strings to display. Like "continue", for example, and others:

CONTINUE
NEW
LOAD

That is fine, English players can understand it. But what about German players? To cater to the German-speaking players, it would need to be replaced. The same goes for French, Italian and all other languages. What would be the best way to do it?

 

What if, hypothetically, the game used a key to represent the meaning of "continue"? Something hardcoded, a default value of sorts, that could be substituted with a real word - a unique key to represent "continue", that the game could automatically substitute with the language-specific expression (value) and show the replaced value to user. But how to tell apart keys from values? How to know if "continue" is a key and not a final value? How to know anything is a key that should be checked? How to make keys stick out like a sore thumb? Again, for illustrative purposes, one could imagine how prefixing keys with a dollar sign - $ - would help them stick out. Like this:

$CONTINUE
$NEW
$LOAD

But to be able to replace the keys with values, there needs to be values, one would think. Maybe collecting all the keys and their values for a specific language could help? In a file, for example, listing them, with something as a separator. An easy-to-read format for everyone could be something like:

$<key>\t<value>\n

That, when put to use (the forum post editor does not like tabs) could look a bit like:

$CONTINUE CONTINUE
$NEW NEW
$LOAD LOAD

The keys could be changed for German, Italian, French and whatever, and it would be easy. Just replace the "CONTINUE" on the right hand side with the German alternatives, or something else entirely:

$CONTINUE AAA
$NEW BBB
$LOAD CCC

The key would remain untouched, however, so the game could find the value to stick into the UI. All the key-value pairs for different languages could then be saved somewhere for the game to use. Handy, one would say. Maybe the game works like this? Who knows. But it would make sense, I think.

 

But how does this have anything to do with the dollar sign issue? Hmm. A good question, really. What if, hypothetically, the game would leave the keys to the UI, in case it fails to find the corresponding values? As in, not replace the default values? What if seeing "$NEW" instead of "NEW" or "NEU" or "FLYING BANANAS" actually means that the game cannot find the list of key-value pairs it needs to replace the keys with something that looks better? Maybe that would make sense?

 

According to the SkyUI wiki at Github, the game keeps its UI localisation files in the following path

Data/Interface/Translate_LANGUAGE.txt

where LANGUAGE is replaced by the current game language. According to the list at the wiki, the game supports CZECH, ENGLISH, FRENCH, GERMAN, ITALIAN, POLISH, RUSSIAN, SPANISH and JAPANESE. So, to list all the potential localisation files:

Data/Interface/Translate_CZECH.txt
Data/Interface/Translate_ENGLISH.txt
Data/Interface/Translate_FRENCH.txt
Data/Interface/Translate_GERMAN.txt
Data/Interface/Translate_ITALIAN.txt
Data/Interface/Translate_POLISH.txt
Data/Interface/Translate_RUSSIAN.txt
Data/Interface/Translate_SPANISH.txt
Data/Interface/Translate_JAPANESE.txt

And according to the same source, there is no fallback to English - only the file for the active language is used. Missing German translation file does not mean that the game will use the English file, instead. So, assuming the user has the game's language set to ENGLISH, and he/she is missing that Translate_ENGLISH.txt file, he/she will most likely see the keys, and not the values? Could that be where those dollar signs are coming from? In case there is no Translate_LANGUAGE.txt file that matches the user's language? Maybe, at least it would seem so.

 

 

One way to go about fixing the base game string issue

 

Assuming the issue is caused by a missing Translation_LANGUAGE.txt for the selected language, the following might or might not help:

  • double-check that the language in Skyrim.ini is the correct one
  • verify game cache through Steam: Library -> right-click The Elder Scrolls V: Skyrim -> Properties -> Local Files tab -> Verify integrity of game cache

If that does not help, as in, if one has the correct language defined, and the translation file present, then the issue is somewhere else. It could be read permissions for any files, or it could be something else entirely. But simply double-checking the language definition and the localisation files should be enough, unless something is really wrong.

 

 

MCM menu strings

 

According to the SkyUI Github wiki, the Skyrim Script Extender (SKSE) extends the existing base game localisation features to allow loading of additional files with key-value pairs in them (so mods do not need to modify the same file). Each active mod in load order can have a localisation file in:

Data/Interface/Translations/modname_LANGUAGE.txt

where nodname is replaced by the data file name without the suffix, and LANGUAGE is replaced by the user's game language. For example, assuming there is a mod

Data/SomeMod.esp

it could have localisation files for all the supported languages:

Data/Interface/Translations/SomeMod_CZECH.txt
Data/Interface/Translations/SomeMod_ENGLISH.txt
Data/Interface/Translations/SomeMod_FRENCH.txt
Data/Interface/Translations/SomeMod_GERMAN.txt
Data/Interface/Translations/SomeMod_ITALIAN.txt
Data/Interface/Translations/SomeMod_POLISH.txt
Data/Interface/Translations/SomeMod_RUSSIAN.txt
Data/Interface/Translations/SomeMod_SPANISH.txt
Data/Interface/Translations/SomeMod_JAPANESE.txt

This SkyUI/SKSE localisation feature is used for translating MCM menus to different languages. One Papyrus script can be used for all the languages, and none of the translations need to be done with properties or other not-easy-to-change things. It is extremely useful and handy, and that is why people use it in their MCM menus. It is a great feature, but there is one downside, as with the base game string translations: If there is no localisation file that matches the language of the user's game, the keys will not be replaced, and there will be dollar signs.

 

Why would an MCM menu not have a localisation file for a specific language? Two reasons come in mind:

  • The mod has been installed incorrectly, so the game cannot find the localisation files.
  • The author of the mod simply has not supplied a localisation file for the user's language.

The reason can be either of those. In the case of something like SkyUI, however, the mod has probably been installed incorrectly. No excuses, double-check your installation. :tongue:

 

 

One way to go about fixing the MCM menu string issue

 

Assuming the mod's MCM uses the localisation feature (as in, the author has not added dollar signs just for fun), one should first check whether the mod has a localisation file for the user's language. As was mentioned, the file(s) should be in:

Data/Interface/Translations/modname_LANGUAGE.txt

If the mod does not have a BSA archive, as in, it comes as loose files, then it is easy to check for the file's existence. Just browse to the path (in wherever you have the mod installed/extracted) and see if the relevant localisation file is there.

 

If the mod comes with a BSA archive, the localisation file(s) can be inside it. It is possible to browse the archive itself, with no need to extract it, to check if it has the relevant file. BSAopt is a great tool for that purpose: http://www.nexusmods.com/skyrim/mods/247

 

If the mod does have a localisation file for the user's language, and the dollar signs are there, then the mod might not have been installed correctly. Reinstalling it correctly usually fixes the issue.

 

If the mod does NOT have a localisation file for the user's language, then it would be handy to make one. At this point, however, it might be possible to ask if the author would be willing to pre-emptively copy-paste the English localisation file, for example, for other languages, as well, and to pack them in the mod. This would result in English texts being dipslayed, but would prevent issues with potentially incomprehensible key strings being displayed to the user.

 

The fastest way, however, and one that does not involve bothering the author in question, would be to copy the existing file and rename it to suit one's game language. Maybe even translate it for one's own use. For example if the mod only has an English localisation file, and the user is seeing dollar signs and weird strings on a German game:

  • If the modname_ENGLISH.txt file is packed inside a BSA archive, it needs to be extracted from it. The Internet should be full of tutorials on how to extract a file from inside a BSA archive
  • The file needs to be copied or renamed to Data/Interface/Translations/modname_GERMAN.txt
  • The game should now load it

Of course, the languages should be the ones that is available and the one that is not, in the specific case, as it will vary, and modname will depend on the mod. That should help the game load the file properly for the appropriate language.

 

For example if the user plays in German, and there is only English file available (in this case, for a mod named "SomeMod.esp"):

Data/Interface/Translations/SomeMod_ENGLISH.txt

The file should be copied and/or renamed so that there is a German one available:

Data/Interface/Translations/SomeMod_ENGLISH.txt
Data/Interface/Translations/SomeMod_GERMAN.txt

And a short description for optionally translating a localisation file:

  • Open the appropriate language version in a capable text editor
  • Replace the value strings with new ones (and keep the tab between key and the value, do not touch the keys)
  • Save the file with the relevant encoding, as in, UTF-16 LE with BOM (as per SkyUI Github wiki instructions)

The file should always follow the defined syntax, with the key remaining untouched. For illustrative purposes, if a mod has ENGLISH file with key-value pair like this (where the space between key and value is really a tab - this forum editor does not like tabs):

$ABC_LongTimeNoSee LongTimeNoBBC

The "$ABC_LongTimeNoSee" is the key - the author of the MCM has made sure that specifically that key right to the last symbol appears in the menu in the place where the value, "LongTimeNoBBC" is supposed to be shown to the user. To translate it to another language, only the value should be touched (while keeping the tab between the key and value):

$ABC_LongTimeNoSee LangeZeitKeinBBC

That should replace "LongTimeNoBBC" with "LangeZeitKeinBBC" in-game - at least in theory.

 

 

Afterword

 

I hope that made some sense, I am terrible when it comes to explaining things, but I thought it would be nice to try and explain one potential reason behind the ominous symbols of foreign currency invading one of our beloved means to escape the reality. :laugh: The most usual (and the only one I know myself) reason for dollar signs in UI strings is a missing localisation file, so that is what I was trying to explain.

 

Sources and other stuff of potential interest:

 

Edit: I will try to make this better when I have the time. Unless that fails, too. Oh well. :facepalm:

 

 

Edited by Contrathetix
Link to comment
Share on other sites

  • 1 month later...
I was actually bored enough to read your wall of text and I'm glad I did because you gave me a great idea.
I want to add support for other languages to my mod, but of course I don't speak 9 different languages, but you know who does? Google. Google currently speaks 98 different languages.
The translation feature seems to ignore the '$' prefixed strings because it doesn't recognize them as words of any kind, which is great. Now, it doesn't seem to transfer capitalization correctly, but that's easy to go back and fix manually. Also, for some strange reason, it switches the key and the value text sometimes? Seems Google's translation code needs a little work, but hey, it's free.
Here's part of my ENGLISH localization file:
$IHO_UpdateComplete Immersive Horses 2.1 update complete.

$IHO_PageTitleOptions Options
$IHO_PageTitleHotkeys Hotkeys

$IHO_HeaderTitleGeneral General
$IHO_HeaderTitleHorses Horses
$IHO_HeaderTitleActivation Activation
$IHO_HeaderTitleMounted Mounted
$IHO_HeaderTitleMyHorse My Horse
$IHO_HeaderTitleMyHerd My Herd
$IHO_HeaderTitleDismounts Dismounts
And here's Google's raw translation to Spanish:
$ IHO_UpdateComplete Immersive Caballos 2.1 actualización completa.

$ Opciones IHO_PageTitleOptions
$ IHO_PageTitleHotkeys teclas de acceso rápido

$ IHO_HeaderTitleGeneral general
$ IHO_HeaderTitleHorses Caballos
Activación $ IHO_HeaderTitleActivation
$ IHO_HeaderTitleMounted Montada
$ IHO_HeaderTitleMyHorse Mi caballo
$ IHO_HeaderTitleMyHerd Mi Rebaño
$ IHO_HeaderTitleDismounts desmonta
See how it juxtaposed the 'Activation' string? And it forgot to capitalize some strings that were originally capitalized? Oh well, better than I can do myself. :smile:

EDIT: It's also putting spaces after each '$'? Haha, easily fixed with Notepad++.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...