Search Unity

KNOT Localization

Discussion in 'Assets and Asset Store' started by V0odo0, Jan 21, 2021.

  1. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328

    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.
     
    Last edited: Apr 11, 2022
    one_one likes this.
  2. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    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.

    Code (CSharp):
    1. [SerializeField] private KnotTextKeyReference _weaponPrefix;
    2. [SerializeField] private KnotTextKeyReference[] _weaponNames;
    3.  
    4. public string GetLocalizedWeaponTitle(int weaponId)
    5. {
    6.     return $"{_weaponPrefix}: {_weaponNames[weaponId]}"; //Weapon: Knife
    7. }

    4. Having strings like

    "<color=red><b>$WeaponName$</b></color> has been upgraded"

    is a headache for translators. To solve this we introduced Metadata and Text Formatter Metadata in particular for such use cases.
     
    Last edited: Jan 29, 2021
    one_one and m039 like this.
  3. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    0.9.0 beta has been released on Asset Store!
     
  4. Looping_co

    Looping_co

    Joined:
    Dec 10, 2016
    Posts:
    20
    Hi,
    I just download it and the asset is great! And a beautiful interface. Do you plan to add TextMeshPro support?
    Best,
     
  5. CrimeCrew

    CrimeCrew

    Joined:
    Feb 9, 2018
    Posts:
    10
    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?


     
    Last edited: Feb 10, 2021
  6. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    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.
     

    Attached Files:

    Looping_co likes this.
  7. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    All localized components has a single key keference, but you can set it manually via script. Here is a simple example:
    Code (CSharp):
    1. public class Test : MonoBehaviour
    2. {
    3.     public int TestKeyId;
    4.     public KnotTextKeyReference[] TestKeys;
    5.     public KnotLocalizedUIText LocalizedText;
    6.  
    7.  
    8.     void Awake()
    9.     {
    10.         LocalizedText.KeyReference = TestKeys[TestKeyId];
    11.     }
    12. }
     
    CrimeCrew likes this.
  8. CrimeCrew

    CrimeCrew

    Joined:
    Feb 9, 2018
    Posts:
    10

    Thank you! This is exactly what I was looking for
     
    Last edited: Feb 11, 2021
  9. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    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.
     
  10. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    KnotAsset is used only by KnotAssetController. It just holds reference to single Unity asset with corresponding metadata at runtime.
     
  11. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Ohh ok, I understand, thanks!
     
  12. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    This looks like a very well made asset, thanks for releasing it for free! Which are the main differences to Unity's localization package?
     
  13. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Hey @V0odo0, now that Unity has the Localization Package, what's going to happen to Knot? Are you still going to work on it?
     
    one_one likes this.
  14. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    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.
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    V0odo0 likes this.
  16. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    karl_jones likes this.
  17. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    one_one and karl_jones like this.
  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Google has a habit of sending people to very old versions :(
     
    one_one likes this.
  19. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    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?
     
  20. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    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
     
  21. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    yosefstudios likes this.
  22. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    v0.9.1-preview available on GitHub.
     
  23. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    v1.0.1 available on GitHub & Asset Store.


    Text Key Reference now may have it's own Text Formatters metadata. As an example usage, you can additionally decorate localized text with color tag.


     
    yosefstudios and one_one like this.
  24. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    v1.1.0 available on GitHub & Asset Store.


    New Addon: OpenAI Autotranslator. Translate your text keys to any language with ChatGPT API in one click.

     
    yosefstudios likes this.
  25. debjoybhowal7

    debjoybhowal7

    Joined:
    Mar 4, 2019
    Posts:
    3
    Hi, will there be support in future for csv or json import/export. for exporting existing collections,keys and translations, and importing the same file back to update the changes? Is something like that possible?
     
  26. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi.

    I've attached experimental version of Import/Export addon.

    1. Create KNOT Localization/Experimental/Import Export asset
    2. Assign source Database
    3. Add CSV Solver and provide Text Collection and Text Asset (imported CSV file)
    4. Tap Import All to import Enabled solvers from Text Asset (CSV) to assigned Text Collection or vice versa.

    Don't forget to made a backup of your CSV files and Text Collection assets.
     

    Attached Files:

    Neil-Corre likes this.
  27. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    v1.2.0 available on GitHub & Asset Store.

    Upd_0.png
     
  28. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    v1.2.2 available on GitHub & Asset Store.

    Small fix to support Unity 2023.2+.
     
  29. Ache_11

    Ache_11

    Joined:
    Apr 3, 2017
    Posts:
    4
    Hi, I tried contacting you about your "Hand Physics Controller" asset through email at contact@vd3v.com but never got an answer. I am interested by your asset and was wondering if it would work with unity 2022 ? The package hasn't been updated since Feb 8, 2017.