From 719bbe2ad865cc214e291db54f85f860ebf9bb8e Mon Sep 17 00:00:00 2001 From: Nick Korotysh Date: Fri, 30 Aug 2024 19:29:43 +0200 Subject: [PATCH] fixed translation issues --- CMakeLists.txt | 2 +- app/gui/settings_dialog.ui | 7 +-- crowdin.yml | 53 +++++++++++++++++++ .../impl/appearance_settings_widget.cpp | 12 ++--- .../impl/appearance_settings_widget.ui | 10 +++- .../spectrum_clock/spectrum_clock_plugin.hpp | 2 +- .../var_translucency_plugin.cpp | 2 +- 7 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 crowdin.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index 2de3951..de82edc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(Qt6 6.5 REQUIRED COMPONENTS Widgets Network Svg OPTIONAL_COMPONENTS Multimedia) find_package(Qt6 6.7 REQUIRED COMPONENTS LinguistTools) -qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES en ru zh_CN) +qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES en ru_RU zh_CN) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) include(clock_utils) diff --git a/app/gui/settings_dialog.ui b/app/gui/settings_dialog.ui index bb270fc..f376717 100644 --- a/app/gui/settings_dialog.ui +++ b/app/gui/settings_dialog.ui @@ -503,7 +503,7 @@ - ... + ... @@ -541,9 +541,6 @@ - - horizontal scaling - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -715,7 +712,7 @@ - ... + ... diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000..8d62122 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,53 @@ +"project_id": "712223" +"api_token_env": "CROWDIN_PERSONAL_TOKEN" +"base_path": "." +"base_url": "https://api.crowdin.com" + +"preserve_hierarchy": true + +files: [ + { + "source": "app/i18n/digital_clock_en.ts", + "translation": "app/i18n/digital_clock_%locale_with_underscore%.ts", + }, + { + "source": "plugin_core/i18n/plugin_core_en.ts", + "translation": "plugin_core/i18n/plugin_core_%locale_with_underscore%.ts", + }, + { + "source": "plugins/any_zoom/i18n/any_zoom_en.ts", + "translation": "plugins/any_zoom/i18n/any_zoom_%locale_with_underscore%.ts", + }, + { + "source": "plugins/chime/i18n/chime_en.ts", + "translation": "plugins/chime/i18n/chime_%locale_with_underscore%.ts", + }, + { + "source": "plugins/countdown_timer/i18n/countdown_timer_en.ts", + "translation": "plugins/countdown_timer/i18n/countdown_timer_%locale_with_underscore%.ts", + }, + { + "source": "plugins/date/i18n/date_en.ts", + "translation": "plugins/date/i18n/date_%locale_with_underscore%.ts", + }, + { + "source": "plugins/quick_note/i18n/quick_note_en.ts", + "translation": "plugins/quick_note/i18n/quick_note_%locale_with_underscore%.ts", + }, + { + "source": "plugins/random_position/i18n/random_position_en.ts", + "translation": "plugins/random_position/i18n/random_position_%locale_with_underscore%.ts", + }, + { + "source": "plugins/spectrum_clock/i18n/spectrum_clock_en.ts", + "translation": "plugins/spectrum_clock/i18n/spectrum_clock_%locale_with_underscore%.ts", + }, + { + "source": "plugins/stopwatch/i18n/stopwatch_en.ts", + "translation": "plugins/stopwatch/i18n/stopwatch_%locale_with_underscore%.ts", + }, + { + "source": "plugins/var_translucency/i18n/var_translucency_en.ts", + "translation": "plugins/var_translucency/i18n/var_translucency_%locale_with_underscore%.ts", + }, +] diff --git a/plugin_core/impl/appearance_settings_widget.cpp b/plugin_core/impl/appearance_settings_widget.cpp index 03d3e28..c83ba61 100644 --- a/plugin_core/impl/appearance_settings_widget.cpp +++ b/plugin_core/impl/appearance_settings_widget.cpp @@ -73,13 +73,13 @@ AppearanceSettingsWidget::AppearanceSettingsWidget( QSignalBlocker ah(ui->align_h_box); QSignalBlocker av(ui->align_v_box); - ui->align_h_box->addItem(tr("left"), Qt::AlignLeft); - ui->align_h_box->addItem(tr("center"), Qt::AlignHCenter); - ui->align_h_box->addItem(tr("right"), Qt::AlignRight); + ui->align_h_box->addItem(tr("left", "alignment"), Qt::AlignLeft); + ui->align_h_box->addItem(tr("center", "alignment"), Qt::AlignHCenter); + ui->align_h_box->addItem(tr("right", "alignment"), Qt::AlignRight); - ui->align_v_box->addItem(tr("top"), Qt::AlignTop); - ui->align_v_box->addItem(tr("center"), Qt::AlignVCenter); - ui->align_v_box->addItem(tr("bottom"), Qt::AlignBottom); + ui->align_v_box->addItem(tr("top", "alignment"), Qt::AlignTop); + ui->align_v_box->addItem(tr("center", "alignment"), Qt::AlignVCenter); + ui->align_v_box->addItem(tr("bottom", "alignment"), Qt::AlignBottom); int hidx = -1; auto halign = cfg.getAlignment() & Qt::AlignHorizontal_Mask; diff --git a/plugin_core/impl/appearance_settings_widget.ui b/plugin_core/impl/appearance_settings_widget.ui index 1b8d851..6ce9e73 100644 --- a/plugin_core/impl/appearance_settings_widget.ui +++ b/plugin_core/impl/appearance_settings_widget.ui @@ -10,6 +10,12 @@ 329 + + + 0 + 0 + + Appearance @@ -171,7 +177,7 @@ - ... + ... @@ -249,7 +255,7 @@ - ... + ... diff --git a/plugins/spectrum_clock/spectrum_clock_plugin.hpp b/plugins/spectrum_clock/spectrum_clock_plugin.hpp index a85db93..8a65b2f 100644 --- a/plugins/spectrum_clock/spectrum_clock_plugin.hpp +++ b/plugins/spectrum_clock/spectrum_clock_plugin.hpp @@ -41,7 +41,7 @@ class SpectrumClockPluginFactory : public ClockPluginFactory public: std::unique_ptr create() const override; - QString title() const override { return tr("\"Spectrum clock\""); } + QString title() const override { return QString("\"Spectrum clock\""); } QString description() const override; bool perClockInstance() const override { return true; } diff --git a/plugins/var_translucency/var_translucency_plugin.cpp b/plugins/var_translucency/var_translucency_plugin.cpp index 9baba19..67f873f 100644 --- a/plugins/var_translucency/var_translucency_plugin.cpp +++ b/plugins/var_translucency/var_translucency_plugin.cpp @@ -73,5 +73,5 @@ std::unique_ptr VarTranslucencyPluginFactory::create() const QString VarTranslucencyPluginFactory::description() const { - return tr("Randomly changes clock position during time."); + return tr("Changes clock opacity level during time."); }