mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
Page:
How to translate i2pd web console to your language
Pages
Coding guidelines
Development team
Differences between i2pd and Java I2P router
Donations
FAQ
Garlic Routing V2
Home
How to run I2Pd on Android 6.
How to translate i2pd web console to your language
I2P internals articles
Migrating hidden services from Java I2P
Our partners
PPA
PR
Performance survey
Publish encrypted LeaseSet
Roadmap
Setting up i2pd as Windows Service
Setup
Testing GOST R 34.10
Use I2P anonymization in your applications
Using i2pd
Using with Retroshare
Windows builds for dev snapshot
Yggdrasil only router configuration
testnet
tunnels.conf
Clone
5
How to translate i2pd web console to your language
R4SAS edited this page 2021-06-15 22:24:49 +03:00
Table of Contents
Translation support for web console was added, so you can translate it to your language.
Using Crowdin
You can translate i2pd to your language on Crowdin. Account required on service to make translations.
For adding new language open discussion on platform. Translations will be pulled manually before release or at any time to trunk.
Manually
For translation take Russian translation code (as most complete), make copy with your language name as file name, and update strings in it.
In that example will be used Turkmen as target language
Translation steps
- Update translation namespace to your language:
namespace i18n
{
-namespace russian // language
+namespace turkmen // language
{
- Update plural form function using information from https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html:
// See for language plural forms here:
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
static int plural (int n) {
- return n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
+ return n != 1 ? 1 : 0;
}
- Update translatable strings and numeric strings in plural form:
static std::map<std::string, std::string> strings
{
// HTTP Proxy
- {"Proxy error", "Ошибка прокси"},
- {"Proxy info", "Информация прокси"},
- {"Proxy error: Host not found", "Ошибка прокси: Адрес не найден"},
+ {"Proxy error", "Proksi ýalňyşlygy"},
+ {"Proxy info", "Proksi maglumat"},
+ {"Proxy error: Host not found", "Proksi ýalňyşlygy: Host tapylmady"},
...
static std::map<std::string, std::vector<std::string>> plurals
{
// ShowUptime
- {"days", {"день", "дня", "дней"}},
- {"hours", {"час", "часа", "часов"}},
+ {"days", {"gün", "gün"}},
+ {"hours", {"sagat", "sagat"}},
...
Note: you can left strings without translation, so use line commenting with // at line start to skip them.
- Add language namespace in i18n header file
I18N_langs.h:
namespace english { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
namespace russian { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
+ namespace turkmen { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
...
and in I18N.h:
inline void SetLanguage(const std::string &lang)
{
if (!lang.compare("russian"))
i2p::context.SetLanguage (i2p::i18n::russian::GetLocale());
+ else if (!lang.compare("turkmen"))
+ i2p::context.SetLanguage (i2p::i18n::turkmen::GetLocale());
- Add commentary about new added language to
i2pd.conf:
-## Currently supported english (default), russian and ukrainian languages
+## Currently supported english (default), russian, turkmen and ukrainian languages
# lang = english
- Make pull request with changes or send your translation file to
r4sas <at> i2pd <dot> xyzto add translation anonymously.