Skip to content

Localization Client

Danylo Lytvynenko edited this page Sep 22, 2020 · 7 revisions

You can use this plugin as a localizer for your project. By filling in Google spreadsheet with the necessary phrases, you can get these phrases in your project using LocalizationClient. Here are the steps to get you going.

Google spreadsheet

First of all, you need to configure your Google spreadsheet. Your first line should be filled with headings, namely Token in the first place, and then EN, Japanese and other languages. Then fill in the given titles, respectively. Example

image

Adding your Localization spreadsheet

After the spreadsheet is ready, you need to add it to your project. For this:

  1. Go to the Spreadsheet tab. And add your spreadsheet ID

image

  1. After loading spreadsheet, go to the tab Localization

image

  1. Choosing the spreadsheet you need

image image

  1. Information about the spreadsheet

image

Use Localization Client

Let's create Localization Client the first

var client = new LocalizationClient();

var client = new LocalizationClient(defaultLangCode, currentLangCode); // defaultLangCode - default language, currentLangCode - current language

List of Available translation languages

var langs = client.Languages; //"EN", "RU", "HZ", "FR"

Get "HZ" phrase for the "Mytoken" token

 client.SetLanguage("HZ");
 var phrase = client.GetLocalizedString("Mytoken");

Get phrase for the "Mytoken" token in Upper Case

var phrase = client.GetLocalizedString("Mytoken", TextType.ToUpper);

Get phrase for the "Mytoken" token in Upper Case

var phrase = client.GetLocalizedString("Mytoken", TextType.ToUpper);

Clone this wiki locally