diff --git a/CMakeLists.txt b/CMakeLists.txt index 05e68a3..ca3c444 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,9 @@ set(LOCALIZATION_SOURCES app/localization/LanguageManager.cpp app/localization/StringIDs.cpp app/localization/English.cpp app/localization/Japanese.cpp - app/localization/German.cpp) + app/localization/German.cpp + app/localization/Spanish.cpp + app/localization/Catalan.cpp) set(APP_SOURCES app/main.cpp app/MainDlg.cpp diff --git a/app/localization/Catalan.cpp b/app/localization/Catalan.cpp new file mode 100644 index 0000000..524cb6e --- /dev/null +++ b/app/localization/Catalan.cpp @@ -0,0 +1,144 @@ +#include "StringIDs.h" +#include "exception" +#include "Languages.h" + +using namespace std; +using namespace string_literals; + +namespace Localization::Catalan +{ + string GetString(int id) + { + switch (id) + { + case StringID::OK: + return "OK"s; + + case StringID::CANCEL: + return "Cancel·lar"s; + + case StringID::CLOSE: + return "Tancar"s; + + case StringID::BONJOUR_INSTALL: +#ifdef _WIN32 + return R"(
Si us plau, instal·la Bonjour per Windows des d'aquest enllaç:
+https://support.apple.com/kb/DL999
)"s; +#else + return "Si us plau, instal·la el servei avahi-daemon i la llibreria libavahi-compat-libdnssd-dev."s; +#endif + case StringID::TROUBLE_SHOOT_RAOP_SERVICE: + return "El servei AirPlay no s'ha pogut iniciar.\nSi us plau, activa el servei Bonjour/Avahi."s; + + case StringID::RECONFIG_RAOP_SERVICE: + return "L'emissió d'àudio s'aturarà breument per reconfigurar el programa!"s; + + case StringID::FAILED_TO_START_DACP_BROWSER: + return "El navegador DACP no s'ha pogut iniciar. El Control Multimèdia no es troba disponible."s; + + case StringID::MENU_FILE: + return "&Fitxer"s; + + case StringID::MENU_QUIT: + return "&Sortir"s; + + case StringID::MENU_EDIT: + return "E&ditar"s; + + case StringID::MENU_OPTIONS: + return "&Opcions..."s; + + case StringID::MENU_HELP: + return "A&juda"s; + + case StringID::MENU_ABOUT: + return "&Sobre..."s; + + case StringID::LABEL_AIRPORT_NAME: + return "Nom Airport"s; + + case StringID::LABEL_AIRPORT_PASSWORD: + return "Contrasenya"s; + + case StringID::LABEL_AIRPORT_CHANGE: + return "Cambiar..."s; + + case StringID::LABEL_TITLE_INFO: + return "Info Pista"s; + + case StringID::TOOLTIP_PREV_TRACK: + return "Anterior"s; + + case StringID::TOOLTIP_NEXT_TRACK: + return "Següent"s; + + case StringID::TOOLTIP_VOLUME_UP: + return "Volum més"s; + + case StringID::TOOLTIP_VOLUME_DOWN: + return "Volum menys"s; + + case StringID::TOOLTIP_PLAY_PAUSE: + return "Play/Pause"s; + + case StringID::STATUS_READY: + return "Tot llest"s; + + case StringID::STATUS_CONNECTED: + return "Conectat a "s; + + case StringID::DIALOG_CHANGE_NAME_PASSWORD: + return "Canvia el Nom Airport i Contrasenya"s; + + case StringID::DIALOG_ABOUT: + return "Sobre"s; + + case StringID::ABOUT_INFO: + return CW2AEX(L"\xA9"s) + " Copyright 2025\nFrank Friemel\n\nShairportQt està basat Shairport de James Laird\n "s; + + case StringID::OPTION_MINIMIZED: + return "Obrir minimitzat"s; + + case StringID::OPTION_AUTOSTART: + return "Autoinici"s; + + case StringID::DIALOG_OPTIONS: + return "Opcions Avançades"s; + + case StringID::LABEL_DATA_BUFFER: + return "Buffering"s; + + case StringID::LABEL_MIN: + return "min"s; + + case StringID::LABEL_MAX: + return "max"s; + + case StringID::LABEL_SOUND_DEVICE: + return "Dispositiu de So"s; + + case StringID::LABEL_LOG_TO_FILE: + return "Guardar registres a fitxer"s; + + case StringID::LABEL_DISABLE_MM_CONTROL: + return "Desactivar Controls Multimèdia"s; + + case StringID::LABEL_DEFAULT_DEVICE: + return "Dispositiu per defecte del sistema"s; + + case StringID::LABEL_KEEP_STICKY: + return "mantenir la finestra sempre visible"s; + + case StringID::LABEL_TRAY_ICON: + return "Icona de safata"s; + + case StringID::MENU_SHOW_APP_WINDOW: + return "&Obrir"s; + + case StringID::MENU_SHOW_TRACK_INFO_IN_TRAY: + return "&Mostra \"Reproduïnt\" a la safata"s; + + } + return English::GetString(id); + } +} diff --git a/app/localization/LanguageManager.cpp b/app/localization/LanguageManager.cpp index eeb8eb1..173e975 100644 --- a/app/localization/LanguageManager.cpp +++ b/app/localization/LanguageManager.cpp @@ -47,6 +47,14 @@ namespace Localization { return Japanese::GetString(id); } + else if (m_currentLanguage == "es-es"s) + { + return Spanish::GetString(id); + } + else if (m_currentLanguage == "ca-es"s) + { + return Catalan::GetString(id); + } return English::GetString(id); } @@ -73,6 +81,8 @@ namespace Localization listPor favor, instala Bonjour para Windows desde este enlace:
+ )"s; +#else + return "Por favor, instala el servicio avahi-daemon y la librería libavahi-compat-libdnssd-dev."s; +#endif + case StringID::TROUBLE_SHOOT_RAOP_SERVICE: + return "El servicio AirPlay no se ha podido iniciar.\nPor favor, activa el servicio Bonjour/Avahi."s; + + case StringID::RECONFIG_RAOP_SERVICE: + return "La emisión de audio se detendrá en breve para reconfigurar el programa!"s; + + case StringID::FAILED_TO_START_DACP_BROWSER: + return "El navegador DACP no se ha podido iniciar. El Control Multimedia no está disponible."s; + + case StringID::MENU_FILE: + return "&Archivo"s; + + case StringID::MENU_QUIT: + return "&Salir"s; + + case StringID::MENU_EDIT: + return "E&ditar"s; + + case StringID::MENU_OPTIONS: + return "&Opciones..."s; + + case StringID::MENU_HELP: + return "A&yuda"s; + + case StringID::MENU_ABOUT: + return "&Acerca de..."s; + + case StringID::LABEL_AIRPORT_NAME: + return "Nombre Airport"s; + + case StringID::LABEL_AIRPORT_PASSWORD: + return "Contraseña"s; + + case StringID::LABEL_AIRPORT_CHANGE: + return "Cambiar..."s; + + case StringID::LABEL_TITLE_INFO: + return "Info Pista"s; + + case StringID::TOOLTIP_PREV_TRACK: + return "Anterior"s; + + case StringID::TOOLTIP_NEXT_TRACK: + return "Siguiente"s; + + case StringID::TOOLTIP_VOLUME_UP: + return "Volumen más"s; + + case StringID::TOOLTIP_VOLUME_DOWN: + return "Volumen menos"s; + + case StringID::TOOLTIP_PLAY_PAUSE: + return "Play/Pause"s; + + case StringID::STATUS_READY: + return "Listo"s; + + case StringID::STATUS_CONNECTED: + return "Conectado a "s; + + case StringID::DIALOG_CHANGE_NAME_PASSWORD: + return "Cambiar Nombre Airport y Contraseña"s; + + case StringID::DIALOG_ABOUT: + return "Acerca de"s; + + case StringID::ABOUT_INFO: + return CW2AEX(L"\xA9"s) + " Copyright 2025\nFrank Friemel\n\nShairportQt está basado en Shairport de James Laird\n "s; + + case StringID::OPTION_MINIMIZED: + return "Iniciar minimizado"s; + + case StringID::OPTION_AUTOSTART: + return "Autoinicio"s; + + case StringID::DIALOG_OPTIONS: + return "Opciones Avanzadas"s; + + case StringID::LABEL_DATA_BUFFER: + return "Buffering"s; + + case StringID::LABEL_MIN: + return "min"s; + + case StringID::LABEL_MAX: + return "max"s; + + case StringID::LABEL_SOUND_DEVICE: + return "Dispositivo de Sonido"s; + + case StringID::LABEL_LOG_TO_FILE: + return "Guardar registros en archivo"s; + + case StringID::LABEL_DISABLE_MM_CONTROL: + return "Desactivar Controles Multimedia"s; + + case StringID::LABEL_DEFAULT_DEVICE: + return "Dispositivo por defecto del sistema"s; + + case StringID::LABEL_KEEP_STICKY: + return "mantener la ventana siempre visible"s; + + case StringID::LABEL_TRAY_ICON: + return "Icono de bandeja"s; + + case StringID::MENU_SHOW_APP_WINDOW: + return "M&ostrar"s; + + case StringID::MENU_SHOW_TRACK_INFO_IN_TRAY: + return "&Mostrar \"Reproduciendo\" en la bandeja"s; + + } + return English::GetString(id); + } +}