Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created February 23, 2015 10:47
Show Gist options
  • Save gluschenko/82df2c21121938beacce to your computer and use it in GitHub Desktop.
Save gluschenko/82df2c21121938beacce to your computer and use it in GitHub Desktop.
using System;
using System.Collections;
/*
Usage:
* GUI.Label(new Rect(10, 10, 100, 100), Local.Get("Play"));
*
*/
public class Local {
public static int LanguageId = 0;
static int LanguagesNum = 4;
static string[] Words = new string[] {
"Play", "Играть", "Грати", "",
"Settings", "Настройки", "Налаштування", "",
"Controls", "Управление", "Управління", "",
"Scoreboard", "Рекорды", "Рекорди", "",
"Credits", "Титры", "Титри", "",
"Quit", "Выйти", "Вийти", "",
"Menu", "Меню", "Меню", "",
"Back", "Назад", "Назад", "",
"Language", "Язык", "Мова", "",
"Please wait...", "Подождите...", "Зачекайте...", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
};
public static string Get(string Orig)
{
for(int i = 0; i < Words.Length; i += LanguagesNum)
{
if(Words[i] == Orig)
{
return Words[i + LanguageId];
}
}
return Orig;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment