LangLink is a localization import plugin designed for Unity that allows importing custom-formatted translation data at runtime.
Based on Unity's Localization package, LangLink provides convenient external language data import features, making it easy for anyone to integrate translation data into their game.
β
Supports dynamic loading of custom-formatted translation data (e.g., TSV, CSV, defined by the developer)
π Registers and switches language resources instantly at runtime
π¦ Fully integrates with Unity Localization package system
π Modular design for easy extension and maintenance
π Allows players or community members to contribute language data, enhancing game internationalization
Whether you are an indie developer or a project team that needs multi-language support, LangLink provides an extensible and low-coupling language data management solution.
The fastest way to start. Keep all default settings, and LangLink will automatically load all translation data under the streamingAssets/LangLink folder.
LangLink.SetupLangLink();- Place translation files into the loading directory (default is
StreamingAssets/LangLink) - Default file format is CSV; you can specify other formats via
LangLink.TargetFileFormat = "*.csv" - Filename format:
<locale>_<tableName>:localeis the language name, which will appear in Unityβs language listtableNamecorresponds to the table name in Unity Localization- You can customize the filename format via the
IFileNameParserinterface
LangLink supports custom translation data formats. Developers can define their own format by implementing the ITableTxtToDictionary interface and registering it in LangLink.
public class MyTableTxtToDictionary : ITableTxtToDictionary
{
public Dictionary<string, string> Convert(string filePath)
{
// Read the file and convert it to a dictionary
// ...
return new Dictionary<string, string>();
}
}
public class Test
{
void Start()
{
// Register custom format translation parser
LangLink.TableParser= new MyTableTxtToDictionary();
// Setup LangLink
LangLink.SetupLangLink();
}
}LangLink provides several core APIs for managing language data. Here are some commonly used ones:
LangLink.SetupLangLink()β Start LangLink with default settingsLangLink.SetupLangLinkAsync()β Start LangLink asynchronously
If you want to control the startup process of LangLink yourself, you can use the following APIs:
LangLink.LoadCustomLocalization()β Load language dataLangLink.LoadCustomLocalization(string path)β Load language data from a specified pathLangLink.LoadCustomLocalizationAsync()β Load language data asynchronouslyLangLink.LoadCustomLocalizationAsync(string path)β Load language data asynchronously from a specified pathLangLink.CreateCustomLocalization(string fileName, string tableTxt)β Create custom language dataAssignTableProvider()β Register a table provider to Unity Localization
"studio.daily.langlink" : "https://github.com/Daily999/langlink.git?path=LangLink"β
Dependencies
LangLink depends on the Unity Localization package. Please make sure your project has it installed:
Unity Localization (recommended version: 1.5.0 or above)
If not installed, you can install it via Package Manager:
Open Unity β Window > Package Manager
Search for "Localization"
Click Install
LangLink supports UniTask for asynchronous operations, providing more efficient async handling.
Make sure UniTask is installed in your project, and import the UniTask namespace where needed.
LangLink internally uses define symbols to switch call methods,
and the define symbols are controlled by assembly definition files.
#if LANGLINK_SUPPORT_UNITASK
// Use UniTask
public static async UniTask<Dictionary<string, string>> LoadCustomLocalizationAsync()
#else
// Standard method
public static async Task<Dictionary<string, string>> LoadCustomLocalizationAsync()
#endifThe method signatures are the same, but the return types differ.
Some implementation suggestions for community-driven translations.
Developers should provide a translation sheet that the community can use to contribute translations. If the content contains sensitive information (such as game story elements or easter eggs), it's recommended to establish a review mechanism.
Community translations are contributed by users, so developers should actively monitor the content to prevent inappropriate or incorrect translations.
Itβs possible to load multiple versions of the same language. You can add version identifiers in the file name, e.g.:
ηΉι«δΈζ<DailyζΌ’εη΅>_UIηΉι«δΈζ<Google MT>_UI
These versions will be displayed as separate languages in the game.
Since translations come from various contributors, developers can reserve a dedicated localization key for translators to include their name or credits in-game.
Translation length may affect UI layout, and overlapping or misaligned text might occur. Translators should try to keep text concise or use Rich Text formatting (if enabled), e.g.:
- Force line break:
<br> - Adjust font size:
<size=20>
Unity Localization supports CultureInfo language codes, which may be used to display locale-specific data such as currency or date formats.
LangLink will attempt to convert table key fields into valid CultureInfo codes and pass them to Unity Localization.
Unity Localization does not allow adding duplicate language codes, so LangLink uses "custom language codes" to support multiple language versions. If your game uses CultureInfo to dynamically format text, this can cause issues.
var culture = LocalizationSettings.SelectedLocale.Identifier.CultureInfo; // β null!Because custom language codes prevent Unity from creating a valid CultureInfo, LangLink provides the GetCurrentCultureInfo() method to retrieve the correct CultureInfo at runtime:
var cultureInfo = LangLink.GetCurrentCultureInfo();
var formattedNumber = (0.3).ToString("N2", cultureInfo);
// or
var formattedNumber2 = Smart.Format(cultureInfo, "{v:P}", new { v = 0.1234 });MIT License. π₯³ If you find this useful, consider supporting me!



