-
Notifications
You must be signed in to change notification settings - Fork 0
Localization Client
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.
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
After the spreadsheet is ready, you need to add it to your project. For this:
- Go to the Spreadsheet tab. And add your spreadsheet ID
- After loading spreadsheet, go to the tab Localization
- Choosing the spreadsheet you need
- Information about the spreadsheet
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 in Upper Case for the "Mytoken" token
var phrase = client.GetLocalizedString("Mytoken", TextType.ToUpper);
Get phrase for the "Mytoken" token from "General" sheet
var phrase = client.GetLocalizedString("Mytoken", "General");
Get phrase in each word with capital for the "Mytoken" token from "General" sheet
var phrase = client.GetLocalizedString("Mytoken", "General", TextType.EachWithCapital);
Get phrase with capital for the "Mytoken" token from "General" sheet. And insert the "Family", "together" in a phrase "{0} joined {1}. Welcome!"
var args = new[]{"Family", "together"});
var phrase = client.GetLocalizedString("Mytoken", "General", TextType.EachWithCapital, args );