diff --git a/contrib/i2pd.conf b/contrib/i2pd.conf index 8cc98e34..43cf7ddd 100644 --- a/contrib/i2pd.conf +++ b/contrib/i2pd.conf @@ -110,8 +110,8 @@ port = 7070 # user = i2pd # pass = changeme ## Select webconsole language -## Currently supported english (default), afrikaans, armenian, german, russian, -## turkmen, ukrainian and uzbek languages +## Currently supported english (default), afrikaans, armenian, french, german, +## russian, turkmen, ukrainian and uzbek languages # lang = english [httpproxy] diff --git a/i18n/French.cpp b/i18n/French.cpp new file mode 100644 index 00000000..d41d215b --- /dev/null +++ b/i18n/French.cpp @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2022, The PurpleI2P Project +* +* This file is part of Purple i2pd project and licensed under BSD3 +* +* See full license text in LICENSE file at top of project tree +*/ + +#include +#include +#include +#include +#include "I18N.h" + +// French localization file + +namespace i2p +{ +namespace i18n +{ +namespace french // language namespace +{ + // language name in lowercase + static std::string language = "french"; + + // See for language plural forms here: + // https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html + static int plural (int n) { + return n != 1 ? 1 : 0; + } + + static std::map strings + { + {"KiB", "Kio"}, + {"MiB", "Mio"}, + {"GiB", "Gio"}, + {"building", "En construction"}, + {"failed", "echoué"}, + {"expiring", "expiré"}, + {"established", "établi"}, + {"unknown", "inconnu"}, + {"exploratory", "exploratoire"}, + {"i2pd webconsole", "Console web i2pd"}, + {"Main page", "Page principale"}, + {"Router commands", "Commandes du routeur"}, + {"Local Destinations", "Destinations locales"}, + {"Tunnels", "Tunnels"}, + {"Transit Tunnels", "Tunnels transitoires"}, + {"I2P tunnels", "Tunnels I2P"}, + {"SAM sessions", "Sessions SAM"}, + {"ERROR", "ERREUR"}, + {"OK", "OK"}, + {"Firewalled", "Derrière un pare-feu"}, + {"Error", "Erreur"}, + {"Offline", "Hors ligne"}, + {"Uptime", "Temps de fonctionnement"}, + {"Network status", "État du réseau"}, + {"Network status v6", "État du réseau v6"}, + {"Stopping in", "Arrêt dans"}, + {"Family", "Famille"}, + {"Tunnel creation success rate", "Taux de succès de création de tunnels"}, + {"Received", "Reçu"}, + {"KiB/s", "kio/s"}, + {"Sent", "Envoyé"}, + {"Transit", "Transit"}, + {"Hidden content. Press on text to see.", "Contenu caché. Cliquez sur le texte pour regarder."}, + {"Router Ident", "Identifiant du routeur"}, + {"Router Family", "Famille du routeur"}, + {"Version", "Version"}, + {"Our external address", "Notre adresse externe"}, + {"Client Tunnels", "Tunnels clients"}, + {"Services", "Services"}, + {"Enabled", "Activé"}, + {"Disabled", "Désactivé"}, + {"Encrypted B33 address", "Adresse B33 chiffrée"}, + {"Domain", "Domaine"}, + {"Note: result string can be used only for registering 2LD domains (example.i2p). For registering subdomains please use i2pd-tools.", "Note: La chaîne résultante peut seulement être utilisée pour enregistrer les domaines 2LD (exemple.i2p). Pour enregistrer des sous-domaines, veuillez utiliser i2pd-tools."}, + {"Address", "Adresse"}, + {"ms", "ms"}, + {"Outbound tunnels", "Tunnels sortants"}, + {"Destination", "Destination"}, + {"Local Destination", "Destination locale"}, + {"", ""}, + }; + + static std::map> plurals + { + {"days", {"jour", "jours"}}, + {"hours", {"heure", "heures"}}, + {"minutes", {"minute", "minutes"}}, + {"seconds", {"seconde", "secondes"}}, + {"", {"", ""}}, + }; + + std::shared_ptr GetLocale() + { + return std::make_shared(language, strings, plurals, [] (int n)->int { return plural(n); }); + } + +} // language +} // i18n +} // i2p diff --git a/i18n/I18N_langs.h b/i18n/I18N_langs.h index c8e88e9a..f3fc6691 100644 --- a/i18n/I18N_langs.h +++ b/i18n/I18N_langs.h @@ -74,6 +74,7 @@ namespace i18n namespace afrikaans { std::shared_ptr GetLocale (); } namespace armenian { std::shared_ptr GetLocale (); } namespace english { std::shared_ptr GetLocale (); } + namespace french { std::shared_ptr GetLocale (); } namespace german { std::shared_ptr GetLocale (); } namespace russian { std::shared_ptr GetLocale (); } namespace turkmen { std::shared_ptr GetLocale (); } @@ -88,6 +89,7 @@ namespace i18n { "afrikaans", {"Afrikaans", "af", i2p::i18n::afrikaans::GetLocale} }, { "armenian", {"հայերէն", "hy", i2p::i18n::armenian::GetLocale} }, { "english", {"English", "en", i2p::i18n::english::GetLocale} }, + { "french", {"Français", "fr", i2p::i18n::french::GetLocale} }, { "german", {"Deutsch", "de", i2p::i18n::german::GetLocale} }, { "russian", {"русский язык", "ru", i2p::i18n::russian::GetLocale} }, { "turkmen", {"türkmen dili", "tk", i2p::i18n::turkmen::GetLocale} },