Gazyi-MultiLanguageStrings icon

MultiLanguageStrings

Localization interface for custom server-side messages.

Last updated 2 weeks ago
Total downloads 31
Total rating 0 
Categories Mods Server-side Client-side
Dependency string Gazyi-MultiLanguageStrings-1.0.0
Dependants 1 other package depends on this package

This mod requires the following mods to function

northstar-Northstar-1.28.2 icon
northstar-Northstar

Titanfall 2 modding and custom server framework.

Preferred version: 1.28.2

README

Gazyi.MultiLanguageStrings

Northstar mod that adds localization interface for custom server-side messages.

Using this mod

Clients

Clients need this mod only if their game language is not English. Unlike in other Portal 2 branch Source games, ConVar cl_language is not flagged as Userinfo. This mod creates Userinfo flagged ConVar cl_mls_serverlang that copies value of cl_language, so servers can receive its value.

Servers and Modders

Client language is checked after connection, by default it's English. For debugging, clients can use console command cl_mls_forcelanguage <language> to override language until level change.

This mod uses JSON translation tables that are located in: <Path to Titanfall 2 game>\R2Northstar\save_data\Gazyi.MultiLanguageStrings. After level change, it'll try to load translation file <Mod Name>.json for every enabled mod.

JSON file example:
{
    "Mod":"Gazyi.MultiLanguageStrings",

    "#HelloWorld":
    {
        "english":"Hello World!",
        "french":"Bonjour le Monde!",
        "german":"Hallo Welt!",
        "spanish":"Hola Mundo!",
        "italian":"Ciao Mondo!",
        "japanese":"こんにちは世界!",
        "polish":"Witaj świecie!",
        "russian":"Привет, мир!",
        "tchinese":"你好世界!",
        "portuguese":"Olá, mundo!",
        "mspanish":"Hola Mundo!"
    }
}
Global functions:

string function ServerLocalizeTokenForClient( entity player, string szToken, string modName ) - Returns translated string for mod token, if it exists. If there's no translation for client language, fallbacks to English.

void function ServerAddTranslationsForToken( string szToken, LocalizedStringStruct localizedStruct, string modName, bool bForceSaveTranslation = false ) - Adds translation for specified token in runtime. Saves current translation table if there's no file for mod or "bForceSaveTranslation" is set to "true".