KNOT Localization


ASSET STORE GITHUB
Documentation WebGL ShowcaseYouTube

KNOT Localization is a lightweight, scalable and extensible texts & assets localization system for Unity.

  • Uses traditional key-value pair collection as a source data structure along with convenient user-friendly interface to access localizable data in one place without having to manually synchronize keys and switch between localization source files.
  • For game designers, it keeps editor workflow as simple as possible: Add Key > Set localized Value > Add Key Reference > Done!
  • For programmers, it has modular architecture with the possibility to implement custom Texts & Assets data sources, runtime data loading & unloading logic (including remote), editable as property & runtime accessible metadata and even the whole localization manager without modifying the codebase.
  • Compatible with all platforms.
  • Full Editor Undo / Redo support.
  • Well organized and commented source code without custom dependencies.
1 Like

Here is the backstory of KNOT Localization. We were working on a project that has to be localized into several languages. In the beginning, localized values were stored as a simple key-value dictionary in ScriptableObject assets. It worked well until the project has started to grow.

1. We were targeting multiple platforms and builds. For example, build A and build B had both their own and the same general localized values. Solved by introducing a Database with references to localization resources. Database can be easily changed trough Project Settings, during runtime or build time to support CI/CD.

2. At some point, we needed to load some of the localized values from a remote server with live update feature for translators. Solved by introducing Collection Providers.

3. To make it easier to keep a reference to localized values and get rid of code embedded key references, we introduced Key Reference. It’s an object that can be serialized and stored anywhere.

Example code

[SerializeField] private KnotTextKeyReference _weaponPrefix;
[SerializeField] private KnotTextKeyReference[] _weaponNames;

public string GetLocalizedWeaponTitle(int weaponId)
{
    return $"{_weaponPrefix}: {_weaponNames[weaponId]}"; //Weapon: Knife
}

4. Having strings like

“<color=red>WeaponName has been upgraded”

is a headache for translators. To solve this we introduced Metadata and Text Formatter Metadata in particular for such use cases.

2 Likes

0.9.0 beta has been released on Asset Store!

Hi,
I just download it and the asset is great! And a beautiful interface. Do you plan to add TextMeshPro support?
Best,

Hello,

first of all a very nice asset. really top class.
Now my question: is it possible to use string arrays? If so, how can I apply this?

Is it possible to change the key reference via a script?


TextMeshPro support is partially done. I’ve attached the package that contains TMPro localized component (KNOT Localization > Localized Text Mesh PRO). It will be included in the next update.

6825380–793082–TextMeshPro for Knot Localization 0.9.0.unitypackage (1.8 KB)

1 Like

All localized components has a single key keference, but you can set it manually via script. Here is a simple example:

public class Test : MonoBehaviour
{
    public int TestKeyId;
    public KnotTextKeyReference[] TestKeys;
    public KnotLocalizedUIText LocalizedText;


    void Awake()
    {
        LocalizedText.KeyReference = TestKeys[TestKeyId];
    }
}

1 Like

Thank you! This is exactly what I was looking for

Hi! I have some questions, but I’ll start with this one: what’s exactly a knot asset (you know, we got Languages, Text, and Assets)? So, it’s not clear to me what is its purpose, or correct usage, and the documentation doesn’t seem to explain it either.

Thanks in advance.

KnotAsset is used only by KnotAssetController. It just holds reference to single Unity asset with corresponding metadata at runtime.

Ohh ok, I understand, thanks!

This looks like a very well made asset, thanks for releasing it for free! Which are the main differences to Unity’s localization package?

Hey @V0odo0 , now that Unity has the Localization Package, what’s going to happen to Knot? Are you still going to work on it?

1 Like

Unity’s localization package has not been updated for a long time. Looks like it was abandoned.

I’m actively using Knot Localization in my ongoing projects without issues so I see no need for updates at the moment. If you found a bug or have any suggestions feel free to reply here.

What makes you think that? The last release was less than 3 weeks ago https://docs.unity3d.com/Packages/com.unity.localization@1.0/manual/index.html

1 Like

Yeah hehe, that’s why I was asking. I noticed that the localization project was quite active and had already left the preview stage

1 Like

You’re right. My bad. Thought it stuck at v0.11 and didn’t even noticed that there is already v1.0.5 available.

2 Likes

Google has a habit of sending people to very old versions :frowning:

1 Like

Hi! So, I just noticed on the asset store page that you can (apparently) create folders to organize Text Keys. But I couldn’t find anything about on how to create those folders. Are they just Asset Key Collections?

Oh, well, I figured it out. The answer was literally on that specific screenshot on the asset store (never thought about it honestly). So it turns out that you have to write Folder.KeyReference, where:

  • Folder is the folder name
  • KeyReference is the key reference name

You can add as many folders as you want (Folder.Subfolder.SubsubFolder, and so on). The last keyword on the string will be the key reference (always).

A more clear example:

  • UI.MainMenu.StartBtn

  • Items.Descriptions.PickaxeDesc