Localized names - how does it work?

Have ideeas but don't know how?
Post Reply
User avatar
ExtremorPL
Modder
Posts: 218
Joined: April 11th, 2019, 7:16 pm
Location: Poland

Localized names - how does it work?

Post by ExtremorPL » January 12th, 2020, 1:12 am

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: "@@warszawa@@" 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: "@@poland@@" 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
Last edited by ExtremorPL on January 12th, 2020, 6:37 pm, edited 1 time in total.
Road to Asia map developer. Our map is going to be released in 2020 so stay tuned. :D
User avatar
BenganJ
Moderator
Posts: 7549
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: Localized names - how does it work?

Post by BenganJ » January 12th, 2020, 1:18 am

Wow mate, that is something that will be welcomed here! THANK YOU! :D :D :D
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
ExtremorPL
Modder
Posts: 218
Joined: April 11th, 2019, 7:16 pm
Location: Poland

Re: Localized names - how does it work?

Post by ExtremorPL » January 12th, 2020, 1:19 am

I hope it will help a lot of new (and maybe also more experienced) modders. ;)
Road to Asia map developer. Our map is going to be released in 2020 so stay tuned. :D
User avatar
MyGodness
Modder
Posts: 62
Joined: February 1st, 2020, 2:25 pm

Re: Localized names - how does it work?

Post by MyGodness » May 4th, 2020, 12:52 pm

Pretty interesting. Thank you for that tutorial. Is it the same way to translate cargo name ?
User avatar
Farmers
Modder
Posts: 19
Joined: February 5th, 2020, 6:01 pm

Re: Localized names - how does it work?

Post by Farmers » May 4th, 2020, 3:17 pm

The only thing, the name can't excess 12 characters :(
Image
- DEV at FSG Map : https://discord.gg/ZXK5e4w
- Model dev, tester at Magrehb map : https://discord.gg/zXX25br
- Tester at Road to asia : https://discord.gg/9ebQSGq
User avatar
BenganJ
Moderator
Posts: 7549
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: Localized names - how does it work?

Post by BenganJ » May 4th, 2020, 4:06 pm

@Farmer'S [TV]

Does that apply in all positions? In file name and in the file?
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
Post Reply