Coder Social home page Coder Social logo

bmjoy / localizationservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suncube/localizationservice

0.0 1.0 0.0 1.65 MB

Tools for localization Unity's UIText components

Home Page: https://assetstore.unity.com/packages/tools/localization/localization-service-50442

C# 100.00%

localizationservice's Introduction

Localization Service GitHub release

Plugin for localization keys. Works with MeshText/UIText/TextMeshPro

Support [email protected] - subject of mail [Localization Sevice]

How to start

  1. Import plugin from Asset Store or copy from GitHub
  2. Create and Load .CSV
  3. Add UILocalization component to MeshText/UIText/TextMeshPro

Create files of localization

Plugin use .CSV files for localization key/value. Create a table of localization and export it to a .CSV file. You can use for this google sheets, because all your team can edit this with sync.

Create for each language its own list.

Save and export each localization to file “Localization” .CSV file or use Download manager

Copy/put the file to the resources (Resources\Localization). Rename the file to language name. !!! Names of languages you can see here

Download Manager

It is possible to download the latest localization changes from your Google sheet. Plugin uses the Google Sheets API . If you want to use your project for working with tables create here .

This tool can be opened by path Window / Localization

Next - open your localization page and copy google sheet IDKey

Copy and paste this to SpreadSheetKey :

Check the path to localization files will be downloaded. (! it must be a folder ../Resources/Localization)

Press SET button

Get session key (this case will be repeated if the key is expired or invalid)

Copy and paste this to AccessCode field:

Press SET button

Now you need to get list of localization , press GET LIST

A list of localizations will shown like:

  1. List can be updated

  2. Localization can be removed from the list of updated localizations

  3. Download selected list

How to use

  1. Select your text component on the scene MeshText/UIText/TextMeshPro and add the component UILocalization.

  2. Set localization’s key or write to the Key field

If the entered key does not exist you will get an error. Check that the key in the localization!

New version include ability to localize multikey. This is very useful when you using tags.

You need enter the keys for each id {0...N}

Change the location in the code

LocalizationService is singleton, for call this use

  LocalizationService.Instance
  • When it is first started, it get and set system language by Application.systemLanguage. You can change logic of first initialize localization value in LocalizationService.GetLocalization().

for example, you can use this enum for languages values ​​in your project

enum SystemLanguage

LocalizationService.Instance.Localization = SystemLanguage.English.ToString();

Get the key in the code

 // for current set localization
LocalizationService.Instance.GetTextByKey("localization1");

or

"localization1".Translate();

You can encode the transition to a new line by adding the translation value "\n". UILocalization make this automaticly, but if you need made this from code use extension for string ParceNewLine().

// key="line" value = "first line \n secondline"
    UIText.text = "line".Translate().ParceNewLine();

Help Tools:

Analytic Keys (in development)

Path to open Window / Localization / Analytic keys This tool will allow you to analyze all keys that are used in the project (!Before starting you need save all changes in the current scene)

Press "Find Use"

  1. Update Analysis

  2. Search prefabs and scenes

  3. Places where there are errors when using

Errors Types: EmptyKey - key not set KeyNotFound - key not found *TextComponent_NotFound *- no supported component on GameObject - MeshText / UIText / TextMeshPro

  1. List of keys that are not used

! Does not check usage in the code of the project like LocalizationService.Instance.GetTextByKey("localization1")

Twitter Facebook YouTube AssetStore

Donate

localizationservice's People

Contributors

suncube avatar nosstanislav avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.