Skip to content

A Polyglot Localization plugin for Unity3d that translates games to many languages

License

Notifications You must be signed in to change notification settings

agens-no/PolyglotUnity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PolyglotUnity

[]

A Unity3d plugin for Polyglot Localization, which is a project that translates games to many languages. This plugin makes it possible to automatically download the polyglot master spreadsheet and a custom game specific spreadsheet and parses it in a unity project.

https://docs.google.com/spreadsheets/d/17f0dQawb-s_Fd7DHgmVvJoEGDMH_yoSd8EYigrb0zmM/

Unity Version

Works with Unity 4.x, 5.x, 2017.x and 2018.x

Tested with several Unity Versions

  • Unity 5.4.4f1
  • Unity 5.5.2f1
  • Unity 5.6.0f3
  • Unity 5.6.1f1
  • Unity 2017.1.0b1
  • Unity 2017.2.0f3
  • Unity 2017.2.0p2
  • Unity 2017.3.0b10
  • Unity 2018.2.2f1
  • Unity 2018.2.5f1
  • Unity 2018.2.9f1
  • Unity 2018.3
  • Unity 2018.4
  • Unity 2019.1
  • Unity 2019.2
  • Unity 2019.3

Feedback

We would 😍 to hear your opinion about this library. Please file an issue if there's something you would like to see improved.

If you use this library and are happy with it consider sending out a tweet mentioning @agens. This library is made with love by Skjalg S. Mæhre.

(http://agens.no/)

First, you need to Configurate the Localization.

You do this by selecting the Configurate menu item from within Unity. This will create the Localization asset for you if it is not set up yet and then select it.

alt tag

Then you can specify the localization settings for the project.

alt tag

Finally you can add Localized Text components to your Text objects

alt tag

Theres also a Language Dropdown script that automatically populates a Dropdown with the available languages

alt tag

Create your own custom spreadsheet

Duplicate the polyglot master sheet and remove all the keys from line 7. The importer parses everything line after the term "polyglot", "PolyMaster" or "BEGIN".

alt tag

Add Sheet and docs id to the Localization Configuration

alt tag

Current Features

  • Download latest polyglot master sheet as CSV or TSV
  • Download a custom localization sheet as CSV or TSV
    • If you use the same keys as the master sheet your keys will override the master sheet.
  • Import the downloaded file and parse it
    • The sheet is parsed every time you play the game so you can iterate fast.
    • Can also be set to downloaded and parsed every time you play the game (optional)
  • Managing localizations
    • Specify any number of csv or tsv files to parse
    • Select language
    • Select fallback language if the localization key does not exist in the currently selected language
    • Invokes event when language is changed
  • Script for localizing UGUI Text component, TextMesh component and TextMesh Pro UGUI component
    • Auto completes localization key
    • Updates text and alignment of text (hebrew and arabic is left to right).
    • Supports parameters for localized strings such as "No {0} Selected".
  • Script for saving selected language
    • Saves to PlayerPrefs
  • TextMesh Pro support
  • Arabic font type support

Additional info for TextMeshPro integration

To use Polyglot with TextMeshPro from the Unity Package Manager (upm) you will need to add the dependency manually to the assembly definition files.

Versions tested:

  • Unity 2018.1.3f1
  • TextMeshPro 1.2.3 (from upm)

Open PolyglotScripts.asmdef and PolyglotEditor.asmdef in a text editor and manually add the dependency to Unity.TextMeshPro.

Your files should look like this:

PolyglotScripts.asmdef

{
    "name": "Polyglot.Scripts",
    "references": ["Unity.TextMeshPro"],
    "optionalUnityReferences": [],
    "includePlatforms": [],
    "excludePlatforms": [],
    "allowUnsafeCode": false
}

PolyglotEditor.asmdef

{
    "name": "Polyglot.Editor",
    "references": [
        "Polyglot.Scripts",
        "Unity.TextMeshPro"
    ],
    "includePlatforms": [
        "Editor"
    ],
    "excludePlatforms": []
}

This makes the scripts find the dependency of TextMeshPro.