MultiLanguageStrings

版本 v1.0.1·更新於 2024-12-15

Localization interface for custom server-side messages.

模組介紹 作者原文

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.

If Northstar adds FCVAR_USERINFO flag to cl_language ConVar, this requirement will be removed.

Servers and Modders

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

This mod uses JSON translation tables that are located in: \R2Northstar\save_data\Gazyi.MultiLanguageStrings. After level change, it'll try to load translation file.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 to runtime translation table. Saves current mod translation table if there's no file for mod or "bForceSaveTranslation" is set to "true".

安裝與使用 安裝:Northstar 用戶端模組

  1. 先安裝 Northstar 用戶端(Titanfall 2 的開源社群用戶端,官方發布頁提供安裝器),模組由它載入。
  2. 把本站下載的壓縮包解壓,內容放入 Titanfall2 目錄下的 Northstar/mods/ 資料夾。
  3. 透過 NorthstarLauncher.exe 啟動遊戲,控制台會列出已載入的模組。

Northstar 用於私人伺服器與自訂內容,請勿用它連線官方伺服器。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

northstar-Northstar

檔案與校驗

檔案名稱
MultiLanguageStrings-1.0.1.zip
檔案大小
85.8 KiB