Browse Source

[qt common] use ConfigurationShared translation context (#4430)

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4430
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
pull/4433/head
PavelBARABANOV 5 days ago
committed by crueter
parent
commit
505b157647
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 6
      src/qt_common/config/shared_translation.cpp

6
src/qt_common/config/shared_translation.cpp

@ -23,7 +23,7 @@ namespace ConfigurationShared {
std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) { std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
std::unique_ptr<TranslationMap> translations = std::make_unique<TranslationMap>(); std::unique_ptr<TranslationMap> translations = std::make_unique<TranslationMap>();
const auto& tr = [parent](const char* text) -> QString { return parent->tr(text); };
const auto& tr = [](const char* text) -> QString { return QCoreApplication::translate("ConfigurationShared", text); };
#define INSERT(SETTINGS, ID, NAME, TOOLTIP) \ #define INSERT(SETTINGS, ID, NAME, TOOLTIP) \
translations->insert(std::pair{SETTINGS::values.ID.Id(), std::pair{(NAME), (TOOLTIP)}}) translations->insert(std::pair{SETTINGS::values.ID.Id(), std::pair{(NAME), (TOOLTIP)}})
@ -368,8 +368,8 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent) { std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent) {
std::unique_ptr<ComboboxTranslationMap> translations = std::unique_ptr<ComboboxTranslationMap> translations =
std::make_unique<ComboboxTranslationMap>(); std::make_unique<ComboboxTranslationMap>();
const auto& tr = [&](const char* text, const char* context = "") {
return parent->tr(text, context);
const auto& tr = [](const char* text, const char* context = "") {
return QCoreApplication::translate("ConfigurationShared", text, context);
}; };
#define PAIR(ENUM, VALUE, TRANSLATION) {static_cast<u32>(Settings::ENUM::VALUE), (TRANSLATION)} #define PAIR(ENUM, VALUE, TRANSLATION) {static_cast<u32>(Settings::ENUM::VALUE), (TRANSLATION)}

Loading…
Cancel
Save