78 lines
3.0 KiB
C++
78 lines
3.0 KiB
C++
#include "locales.h"
|
||
|
||
std::map<const std::string, LocaleMap*> locales;
|
||
|
||
// Russian
|
||
LocaleMap ru_RU = {
|
||
// Locale Info
|
||
{"locale.name", "Русский"},
|
||
{"locale.fullname", "Русский (Russian)"},
|
||
// Loading
|
||
{"loading.checkUpdates", "Проверяем обновления"},
|
||
{"loading.i2p", "Запускаем i2p"},
|
||
{"loading.isJavaInst", "Проверка установки Java"},
|
||
{"loading.installJava", "Установка Java"},
|
||
{"loading.gettingEndpoint", "Получаем Endpoint API"},
|
||
{"loading.logging", "Обрабатываем данные лаунчера"},
|
||
{"loading.setupLocale", "Устанавливаем язык лаунчера"},
|
||
{"loading.end", "Закончили. Приятной игры"},
|
||
{"loading.installI2P", "Установка I2P"},
|
||
{"loading.isMinecraftInst", "Проверим установлен ли Майнкрафт"},
|
||
// Welcome
|
||
{"welcome.main", "Главная"},
|
||
{"welcome.settings", "Настройки"},
|
||
{"welcome.authorise", "Авторизация"},
|
||
{"welcome.showPassword", "Показать пароль"},
|
||
{"welcome.logIn", "Войти"},
|
||
{"welcome.register", "Зарегистрироваться"},
|
||
// I2PD
|
||
{"i2pd.errorTitle", "Ошибка I2P"},
|
||
{"i2pd.errorDescription.p1", "I2P Завершилась с фатальной ошибкой:\n\n"},
|
||
{"i2pd.errorDescription.p2", "\n\nЛаунчер будет закрыт."},
|
||
};
|
||
|
||
// English
|
||
LocaleMap en_US = {
|
||
// Locale Info
|
||
{"locale.name", "English"},
|
||
{"locale.fullname", "English (English)"},
|
||
// Loading
|
||
{"loading.checkUpdates", "Checking updates"},
|
||
{"loading.i2p", "Starting i2p"},
|
||
{"loading.isJavaInst", "Checking Is Java installed"},
|
||
{"loading.installJava", "Java installation"},
|
||
{"loading.gettingEndpoint", "Getting Endpoint API"},
|
||
{"loading.logging", "Handle the launcher data"},
|
||
{"loading.setupLocale", "Setup the launcher's language"},
|
||
{"loading.end", "Finished. Let's start"},
|
||
{"loading.installI2P", "Installing I2P"},
|
||
{"loading.isMinecraftInst", "Checking Is Minecraft installed"},
|
||
// Welcome
|
||
{"welcome.main", "Home"},
|
||
{"welcome.settings", "Settings"},
|
||
{"welcome.authorise", "Authorization"},
|
||
{"welcome.showPassword", "Show the password"},
|
||
{"welcome.logIn", "LogIn"},
|
||
{"welcome.register", "Registration"},
|
||
// I2PD
|
||
{"i2pd.errorTitle", "I2P Error"},
|
||
{"i2pd.errorDescription.p1", "A fatal error occurred while running i2pd:\n\n"},
|
||
{"i2pd.errorDescription.p2", "\n\nThe launcher will now close."},
|
||
};
|
||
|
||
void initLocales () {
|
||
locales["ru_RU"] = &ru_RU;
|
||
locales["ru_UA"] = &ru_RU;
|
||
locales["en_US"] = &en_US;
|
||
//locales["en_UK"] = &en_US;
|
||
}
|
||
|
||
LocaleMap* getLocale () {
|
||
std::string locale = (QLocale::system()).name().toStdString();
|
||
if (locales.find(locale) == locales.end()) {
|
||
locale = "en_US";
|
||
}
|
||
LocaleMap* localeMap = locales[locale];
|
||
return localeMap;
|
||
}
|