PDA

View Full Version : How to translate an existing mod (STBL editing)


plasticbox
8th Jan 2016, 1:48 PM
This is a simple way to improve a mod that is not available in your language, showing English text instead. If you come across a mod where strings are missing entirely (resulting in ***DEBUG*** or no text being shown), you can also repair it this way. Either just for yourself, or even better, for everybody ‒ most creators will probably appreciate when you post additional strings for their uploads (it’s hardly possible to properly localise a mod when you don’t have the game installed in the target language, so that is something that usually requires the help of others).


STBL IDs and locale codes:

Strings ( = bits of text that the game is using to show in the interface) are stored in string tables, type 0x220557DA (STBL). These resources usually come in bundles, numbered like this:

0x220557DA-0x80000000-0x002505EF3F075A02
0x220557DA-0x80000000-0x012505EF3F075A02
0x220557DA-0x80000000-0x022505EF3F075A02
..
0x220557DA-0x80000000-0x152505EF3F075A02

The numbers in bold are the locale code, which is how the game tells apart the different languages ‒ 07 is the locale code for French for example; if you have the game installed in French it will look for the STBL where the ID starts with 07 and use the strings from that.


0x00 : "ENG_US"
0x02 : "CHT_CN"
0x03 : "CZE_CZ"
0x04 : "DAN_DK"
0x05 : "DUT_NL"
0x06 : "FIN_FI"
0x07 : "FRE_FR"
0x08 : "GER_DE"
0x0B : "ITA_IT"
0x0C : "JPN_JP"
0x0D : "KOR_KR"
0x0E : "NOR_NO"
0x0F : "POL_PL"
0x11 : "POR_BR"
0x12 : "RUS_RU"
0x13 : "SPA_ES"
0x15 : "SWE_SE"
Maxis have also posted the locale codes and some other info on STBL here (http://forums.thesims.com/en_US/discussion/859729).


Context:

It is probably a good idea to use the untranslated mod at least once before you edit it, so that you can see how the strings are being used in game ‒ for instance, with the mod I’m using for this example, you couldn’t tell what the difference between “Prepare” and “Serve” ought to be just from looking at the package by itself (but when you’ve used it in game, you might have noticed that when a sim makes a single meal, it’s called “Prepare Suchandsuch”; the group meals have “Serve suchandsuch” instead. This differentiation may not exist in all languages.).


How to edit the strings in a package:

1. Open the package in s4pe (https://github.com/s4ptacle/Sims4Tools/releases)

2. On the left-hand side, you see a list of resources in this package; scroll to the STBL resources (you can click on Tag/Type/Group etc at the top to sort the list) and find the one with your locale code ‒ 08 in this case, which should be German but is obviously not, as you can see in the preview on the right side

3. Click on the “Grid” button at the bottom of the window; in the little window that opens, click on the three dots

4. Now you have the data grid in front of you, again with a list of contents on the left, and the actual content (key/value pairs) on the right. To enter your translation, simply overwrite the text in “Value” (don’t mess with the “Key” field, that needs to remain unchanged). The text can contain stuff like “\n” which is a newline character, or text variables like “{0.SimFirstName}” or “{F1.she}{M1.he}” (this will be replaced by the name of the active sim / the pronoun that matches the sim’s gender); those should not be changed. Some creators also have URLs in there that shouldn’t be edited out ‒ they are important for users to be able to tell where they got a mod from.

5. When you have entered the translated text in all fields, hit “OK”, then “Commit”. The preview on the right should now show your translated text.

6. If you want to post this translation somewhere, right-click on the resource that you edited > Export > To File. Save it somewhere, zip it and post it.

7. Save the package (File > Save) and you’re done.


If you need the game strings in various languages for reference, some have been posted in this thread (http://modthesims.info/showthread.php?t=539386).

Also, for managing a lot of languages there are tools like this (http://modthesims.info/download.php?t=564576) ‒ but that looks more useful for people who actually create a mod, rather than edit just one language.

Easybe
22nd Jan 2016, 12:42 PM
Hallo, I need help...
Why my GRID isn't enabled and the descriptions say?:
Error reading resource 0x220557DA-0x80000000-0x0B3AD36FDEC973CE
Front-end Distribution:
Library Distribution:

Source: s4pi.WrapperDealer
Assembly: s4pi.WrapperDealer, Version=1509.15.616.13102, Culture=neutral, PublicKeyToken=null
Could not find a resource handler
What missing?
Thank's very much
Easybe

plasticbox
22nd Jan 2016, 1:09 PM
How/where are you getting this error? Is this an existing STBL that you are trying to edit? If yes, some CC has STBLs with incorrect length information -- the game doesn't care but the current version of s4pe doesn't display that. Is fixed in the next version but that is not published yet.

You could try two things: either use the STBL editor from here http://modthesims.info/download.php?t=564576 , see if that can read it, or if you know the keys you need, you can also add a new STBL and delete the existing one.

Also, make sure you unzip s4pe with 7zip, not with winrar.

Easybe
22nd Jan 2016, 7:14 PM
Thanks for your reply.
I have unzipped s4pe with winrar, sorry...
I search 7zip and i try again.
I would update my cc mods with italian language, like you have shown, but for me is all new.
your instructions are very good.
thanks

plasticbox
22nd Jan 2016, 10:32 PM
Since you say "cc mods" -- if those are objects, you can see the keys for name and description in the COBJ resource (NameHash, DescriptionHash; right at the top of the preview). So if you can't manage to open the STBLs you can simply create one, and put two entries with those keys in there.

Easybe
23rd Jan 2016, 3:54 PM
Now i can modify the language because the program it's ok, but i have into my folder mods some objects that give me error.
is possible to correct this objects? if the procedure isn't very hard, you can teach me?
thanks very really

plasticbox
23rd Jan 2016, 5:03 PM
See the above post. If it's only the object name and description you want to translate, you can see the keys in COBJ. Make a new STBL with your language code, add strings for those keys, and delete the old STBL. You probably shouldn't do this with objects that have custom functions etc (more text than just name and description), try the STBL editor that I've linked to several times now.

Easybe
23rd Jan 2016, 7:16 PM
wonderful, I have tried and I done center.
Thanks, now I have understood and so I can work very well

plasticbox
9th Feb 2016, 5:03 AM
some CC has STBLs with incorrect length information -- the game doesn't care but the current version of s4pe doesn't display that. Is fixed in the next version but that is not published yet.

This is published now: https://github.com/s4ptacle/Sims4Tools/releases/tag/v0.4.2-beta

Several updates/fixes for STBL; should make it easier to deal with STBL resources that are mangled in some way.

Tshelky
23rd Aug 2017, 4:47 PM
Thanks, this was really helpfull. I was wondering, what if you need to translate a sentence for both genders? If you know what I mean.

Pudin
24th Mar 2020, 8:59 AM
Someone by any chance have all the "{.}" of the game? I need them separately if can -I'm not a modder :,D
I specifically need to mention the spouse of a sim with the gender alternatively... because is spanish.

kiraieee
8th Jun 2020, 11:38 PM
thanks , is there a way to automatically translate it ? i have huge a package with about more than 600 text