Page 1 of 1

Localized names - how does it work?

Posted: 12 Jan 2020 00:06
by ExtremorGP
Introduction
Hi guys, here is short and simple tutorial how to add support for localized names to your mod.
SCS added this feature in 1.33 game version so it won't work on 1.32 and so on.
It is really easy and it won't take you more than 5 minutes to learn it.

1. Adding localization key to existing definitions.
First of all, make sure you have this fuction added in your definitions.
Here's an example city of Warsaw (file def/city/warszawa.sii).

city_data: city.warszawa
{
city_name: "Warszawa" Local city name, do NOT translate it!
city_name_localized: "@@[email protected]@" Here is your localization key. It has to be in @@s. More about it later.
country: poland
}


And also here is an example of country. Poland in this case (file def/country/poland.sii).

country_data : country.data.poland
{
country_id: 8

name: "Polska" Local country name, do NOT translate it!
name_localized: "@@[email protected]@" Here is your localization key. It has to be in @@s. More about it later.
country_code: "PL"
}


Don't use special characters in your localization key (like #, $, % or ą, ś, ć and so on) and also CAPITAL letters. And don't use more than 14 characters (I think there's no limit but it's better to don't make too long keys in my opinion).
Leave folder with your cities (and countries) to translate opened, you'll need it later.

2. Local folder.
You can't extract this folder from game files using normal scs file extractor. I don't know why. Anyway, you don't need it.
  • Open your mod folder. Don't go inside any folder like def or material. Create a new folder and change its name to locale.
  • Open it and create a new folder. This folder has to be named with language ID.
    Here is list of all language IDs from SCS wiki:
    bg_bg, ca_es, cs_cz, da_dk, de_de, el_gr, en_gb, en_us, es_es, es_la, et_ee, eu_es, fi_fi, fr_fr, gl_es, hr_hr, hu_hu, it_it, ja_jp, ka_ge, ko_kr, lt_lt, lv_lv, mk_mk, nl_nl, no_no, pl_pl, pl_si, pt_br, pt_pt, ro_ro, ru_ru, sk_sk, sl_sl, sr_sp, sr_sr, sv_se, tr_tr, uk_uk, vi_vn, zh_cn, zh_tw
    This is also list of all supported languages. You can't translate your mod to e.g persian or arabic.
    We want to translate our mod to russian, so our folder name is ru_ru.
  • Open it and create a new file called local_module.whatuwant.sii, where whatuwant can be replaced with everything you want but you can't use special characters and so on.
  • Here you have file structure you should follow.

    Code: Select all

    SiiNunit
    {
    localization_db : .localization
    {
    	#TIME ZONES
            key[]: "tz_aft"
            val[]: "AFT" #Afghanistan Time
    
    	#AFGHANISTAN
            key[]: "afghanistan"
            val[]: "Афганистан"
    
    	#POLAND
            key[]: "poland"
            val[]: "Польша"
    
            key[]: "warszawa"
            val[]: "Варшава"
    }
    }
    key[]: "poland" Here is our key. Copy it from your definitions WITHOUT @@s.
    val[]: "Польша"
    Here is our translated name. You can use special characters and capital letters here. You can use more than 12 characters.
It's all you have to do. You can add more lines if you need. You can also add localized time zone names and probably more things, just make some experiments with it.
You have to add localization to every language manually. If you won't add it for some language, game will use your localization key, NOT english variant. If you cannot afford translating your mod to each language I recommend to at least copy english localization to rest of them. If you want to translate your mod to language you aren't familiar with, you can use Google Maps. Just change your language on that site.

This tutorial is going to be updated and improved with more fuctions.
Good luck! :D