Skip to content

Commit

Permalink
Integration of Czech translations
Browse files Browse the repository at this point in the history
Refs: #58
  • Loading branch information
orontee committed Oct 13, 2023
1 parent 3c12d7d commit d2cea61
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 201 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Added

- Czech translations
[#58](https://github.com/orontee/taranis/issues/58)

- Dump/Restore most of model in application state
[#57](https://github.com/orontee/taranis/issues/57)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ e-book reader.

* History of locations

* Translations (English, French, Polish)
* Translations (English, Czech, French, Polish)

Weather data is provided by [OpenWeather](https://openweathermap.org).

Expand Down
5 changes: 2 additions & 3 deletions src/about.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ namespace taranis {
"For more details, read GNU General Public License,"
" version 3 or later") << "\n\n"
<< GetLangText("Credits") << "\n"
<< " ⸱ Cyfranek\n"
<< " ⸱ neilswann80\n"
<< " ⸱ Matthias Meulien" << std::endl;
<< " Cyfranek - Matthias Meulien - neilswann80 - vita56"
<< std::endl;
return content.str();
}
}
Expand Down
219 changes: 22 additions & 197 deletions src/l10n.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,214 +3,39 @@
#include <boost/log/trivial.hpp>
#include <cstring>
#include <inkview.h>
#include <map>
#include <string>

namespace taranis {

typedef std::map<std::string, std::string> Translations;

namespace l10n {
const extern Translations cs_translations;
const extern Translations fr_translations;
const extern Translations pl_translations;
} // namespace l10n

inline void initialize_translations() {
const auto current_language = currentLang();

BOOST_LOG_TRIVIAL(debug) << "Initializing translations " << current_language;

LoadLanguage(current_language);

if (std::strcmp(current_language, "fr") == 0) {
// French translations

// about.cc.in
AddTranslation(
"This program is provided without any warranty. For more details, "
"read GNU General Public License, version 3 or later",
"Ce programme est fourni sans aucune garantie. Pour plus de détails, "
"lisez la License publique générale GNU, version 3 ou ultérieure.");
AddTranslation("Credits", "Crédits");

// alerts.h
AddTranslation("Alert", "Alerte");
AddTranslation("Start", "Début");
AddTranslation("Duration", "Durée");
AddTranslation("Source", "Source");
AddTranslation("Next alert", "Alerte suivante");

// app.h
AddTranslation("Unsupported software version", "Logiciel incompatible");
AddTranslation("The application isn't compatible with the software version "
"of this reader.",
"L'application n'est pas compatible avec la version "
"logicielle de ce matériel.");
AddTranslation("Network error", "Erreur réseau");
AddTranslation(
"Failure while fetching weather data. Check your network connection.",
"Échec lors du rapatriement des données météorologiques. Vérifier la "
"connexion réseau.");
AddTranslation("Service unavailable", "Service indisponible");
AddTranslation("Invalid input", "Saisie invalide");
AddTranslation(
"Make sure you enter a town then a country separated by a comma.",
"Assurez-vous d'avoir saisi des noms de ville et de pays séparés par "
"une virgule.");

// currentconditionbox.h
AddTranslation("Felt", "Ressenti");

// errors.h
AddTranslation("Location unknown to the service providing weather data. "
"Check spelling.",
"Localité inconnue du fournisseur de données "
"météorologiques. Vérifier l'orthographe.");
AddTranslation("Sorry, an unexpected error was encountered. Report this to "
"the application author.",
"Désolé, une erreur inattendue est survenue. Contacter le "
"responsable de l'application.");
AddTranslation(
"An API key is required to consume weather data. Contact the "
"application maintainer.",
"Une clé d'API est requise pour consommer les données météorologiques. "
"Contacter le responsable de l'application.");
AddTranslation(
"Weather data can't be accessed with the provided API key.",
"La clé d'API ne permet pas de consulter les données météorologiques.");
AddTranslation("The service providing weather data isn't working as "
"expected. Retry later.",
"Le fournisseur de données météorologiques est "
"hors-service. Réessayer plus tard.");

// locationlist.cc
AddTranslation("Longitude", "Longitude");
AddTranslation("Latitude", "Latitude");

// menu.h
AddTranslation("Standard", "Standard");
AddTranslation("Metric", "Système métrique");
AddTranslation("Imperial", "Unités impériales");
AddTranslation("Refresh", "Mettre à jour");
AddTranslation("Locations", "Lieux");
AddTranslation("Units", "Unités");
AddTranslation("About…", "À propos…");
AddTranslation("Quit", "Quitter");
AddTranslation("Add to favorites", "Ajouter aux favoris");
AddTranslation("Remove from favorites", "Retirer des favoris");
AddTranslation("Empty", "Vide");

// statusbar.h
AddTranslation("Ongoing update…", "Mise à jour en cours…");
AddTranslation("Last update:", "Mis à jour :");
AddTranslation("Weather data from", "Données météorologiques de");

// ui.h
AddTranslation("Sunrise", "Lever");
AddTranslation("Sunset", "Coucher");
AddTranslation("Pressure", "Pression");
AddTranslation("Humidity", "Humidité");
AddTranslation("UV index", "Index UV");
AddTranslation("Visibility", "Visibilité");
AddTranslation("Wind", "Vent");
AddTranslation("Gust", "Rafale");

const Translations *translations{nullptr};
if (std::strcmp(current_language, "cs") == 0) {
translations = &l10n::cs_translations;
} else if (std::strcmp(current_language, "fr") == 0) {
translations = &l10n::fr_translations;
} else if (std::strcmp(current_language, "pl") == 0) {
// Polish translations

// about.cc.in
AddTranslation(
"This program is provided without any warranty. For more details, "
"read GNU General Public License, version 3 or later",
"Ta aplikacja jest dostarczona bez żadnej gwarancji. Aby poznać "
"więcej, "
"zapoznaj się z warunkami GNU General Public License w wersji 3 lub "
"nowszej.");
AddTranslation("Credits", "Kredyty");

// alerts.h
AddTranslation("Alert", "Alert");
AddTranslation("Start", "Zacznij o");
AddTranslation("Duration", "Przez");
AddTranslation("Source", "Źródło");
AddTranslation("Next alert", "Następne powiadomienie");

// app.h
AddTranslation("Unsupported software version",
"Nieobsługiwana wersja oprogramowania");
AddTranslation("The application isn't compatible with the software version "
"of this reader.",
"Aplikacja nie jest zgodna z oprogramowaniem "
"tego czytnika.");
AddTranslation("Network error", "Błąd połączenia");
AddTranslation(
"Failure while fetching weather data. Check your network connection.",
"Wystąpił błąd podczas pobierania danych pogodowych. Sprawdź "
"połączenie sieciowe.");
AddTranslation("Service unavailable", "Usługa niedostępna");
AddTranslation("Invalid input", "Wprowadzono błędne dane");
AddTranslation(
"Make sure you enter a town then a country separated by a comma.",
"Upewnij się, że podano poprawnie nazwę miasta i państwa "
"rozdzielone przecinkiem.");

// currentconditionbox.h
AddTranslation("Felt", "Temp. odczuwalna");

// errors.h
AddTranslation("Location unknown to the service providing weather data. "
"Check spelling.",
"Lokalizacja nieznana w serwisie pogodowym. "
"Sprawdź pisownię.");
AddTranslation("Sorry, an unexpected error was encountered. Report this to "
"the application author.",
"Wystąpił błąd aplikacji. Poinformuj "
"autora.");
AddTranslation(
"An API key is required to consume weather data. Contact the "
"application maintainer.",
"Do pobierania danych pogodowych wymagany jest klucz API. "
"Skontaktuj się z autorem aplikacji.");
AddTranslation(
"Weather data can't be accessed with the provided API key.",
"Dane pogodowe nie są dostępne przy użyciu tego klucza API.");
AddTranslation("The service providing weather data isn't working as "
"expected. Retry later.",
"Serwis udostępniający dane pogodowe nie działa zgodnie"
"z oczekiwaniami. Spróbuj później.");

// locationlist.cc
AddTranslation("Longitude", "Długość geo.");
AddTranslation("Latitude", "Szerokość");

// menu.h
AddTranslation("Standard", "SI");
AddTranslation("Metric", "Metryczne");
AddTranslation("Imperial", "Imperialne");
AddTranslation("Refresh", "Odśwież");
AddTranslation("Locations", "Lokalizacje");
AddTranslation("Units", "Jednostki");
AddTranslation("About…", "O aplikacji");
AddTranslation("Quit", "Wyjście");
AddTranslation("Add to favorites", "Dodaj do ulubionych");
AddTranslation("Remove from favorites", "Usuń z ulubionych");
AddTranslation("Empty", "Pusty");

// statusbar.h
AddTranslation("Ongoing update…", "Trwa aktualizacja…");
AddTranslation("Last update:", "Ostatnia aktualizacja:");
AddTranslation("Weather data from", "Dane pogodowe z");

// ui.h
AddTranslation("Sunrise", "Wschód słońca");
AddTranslation("Sunset", "Zachód słońca");
AddTranslation("Pressure", "Ciśnienie");
AddTranslation("Humidity", "Wilgotność");
AddTranslation("UV index", "Indeks UV");
AddTranslation("Visibility", "Widoczność");
AddTranslation("Wind", "Wiatr");
AddTranslation("Gust", "Porywisty wiatr");

} else if (std::strcmp(current_language, "de") == 0) {
// German translations

// currentconditionbox.h
AddTranslation("Felt", "Gefühlt");
translations = &l10n::pl_translations;
}

// statusbar.h
AddTranslation("Ongoing update…", "Laufendes Update…");
AddTranslation("Last update:", "Aktualisiert am:");
AddTranslation("Weather data from", "Wetterdaten von");
if (translations) {
for (const auto &translation : l10n::fr_translations) {
AddTranslation(translation.first.c_str(), translation.second.c_str());
}
}
}
} // namespace taranis
94 changes: 94 additions & 0 deletions src/l10n/cs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#include "../l10n.h"

namespace taranis {
namespace l10n {

// Czech translations

const Translations cs_translations{
// about.cc.in
{"This program is provided without any warranty. For more details, "
"read GNU General Public License, version 3 or later",
"Tento program je bez jakékoliv záruky. Další podrobnosti jsou"
"v GNU General Public License, verze 3 nebo novější."},
{"Credits", "Poděkování"},

// alerts.h
{"Alert", "Výstraha"},
{"Start", "Začátek"},
{"Duration", "Přes"},
{"Source", "Zdroj"},
{"Next alert", "Následující výstraha"},

// app.h
{"Unsupported software version", "Nepodporovaná verze programu"},
{"The application isn't compatible with the software version "
"of this reader.",
"Aplikace není kompatibilní s programovou verzí "
"této čtečky."},
{"Network error", "Chyba sítě"},
{"Failure while fetching weather data. Check your network connection.",
"Chyba při stahování dat o počasí. Zkontroluj "
"síťové připojení."},
{"Service unavailable", "Služba není dostupná"},
{"Invalid input", "Neplatné zadání"},
{"Make sure you enter a town then a country separated by a comma.",
"Zkontroluj, zda je správné jméno města a potom státu"
"oddělené čárkou."},

// currentconditionbox.h
{"Felt", "Pocitová teplota"},

// errors.h
{"Location unknown to the service providing weather data. "
"Check spelling.",
"Lokalita není známá ve službě počasí. "
"Zkontroluj zápis."},
{"Sorry, an unexpected error was encountered. Report this to "
"the application author.",
"Chyba aplikace. Informuj autora."},
{"An API key is required to consume weather data. Contact the "
"application maintainer.",
"Pro odběr daných dat o počasí je vyžadován klíč API. "
"Kontaktuj autora aplikace."},
{"Weather data can't be accessed with the provided API key.",
"Data o počasí nejsou dostupná s tímto klíčem API."},
{"The service providing weather data isn't working as "
"expected. Retry later.",
"Služba poskytující data o počasí nepracuje správně"
"Zkus později."},

// locationlist.cc
{"Longitude", "Zem. délka"},
{"Latitude", "Zem. šířka"},

// menu.h
{"Standard", "SI"},
{"Metric", "Metrické"},
{"Imperial", "Imperiální"},
{"Refresh", "Aktualizuj"},
{"Locations", "Lokality"},
{"Units", "Jednotky"},
{"About…", "O aplikaci"},
{"Quit", "Konec"},
{"Add to favorites", "Přidat do oblíbených"},
{"Remove from favorites", "Odebrat z oblíbených"},
{"Empty", "Prázdný"},

// statusbar.h
{"Ongoing update…", "Probíhá aktualizace…"},
{"Last update:", "Poslední aktualizace:"},
{"Weather data from", "Data o počasí z"},

// ui.h
{"Sunrise", "Východ slunce"},
{"Sunset", "Západ slunce"},
{"Pressure", "Tlak"},
{"Humidity", "Vlhkost"},
{"UV index", "Index UV"},
{"Visibility", "Viditelnost"},
{"Wind", "Vítr"},
{"Gust", "Nárazový vítr"},
};
} // namespace l10n
} // namespace taranis
Loading

0 comments on commit d2cea61

Please sign in to comment.