Qt: Add translation support (#664)

* Translation PoC

* i18n but better

* More Greek translation

* Add proper translation UI

* Linux CI: Install qt6-tools-dev
This commit is contained in:
wheremyfoodat
2024-12-04 21:08:33 +02:00
committed by GitHub
parent 28461a1d44
commit bfdc6f0240
11 changed files with 1656 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ struct FrontendSettings {
Theme theme = Theme::Dark;
WindowIcon icon = WindowIcon::Rpog;
std::string language = "en";
static Theme themeFromString(std::string inString);
static const char* themeToString(Theme theme);

View File

@@ -45,6 +45,8 @@ class ConfigWindow : public QDialog {
void setTheme(FrontendSettings::Theme theme);
void setIcon(FrontendSettings::WindowIcon icon);
QComboBox* createLanguageSelect();
public:
ConfigWindow(ConfigCallback configCallback, MainWindowCallback windowCallback, const EmulatorConfig& config, QWidget* parent = nullptr);
~ConfigWindow();

View File

@@ -126,6 +126,7 @@ class MainWindow : public QMainWindow {
void setupControllerSensors(SDL_GameController* controller);
void sendMessage(const EmulatorMessage& message);
void dispatchMessage(const EmulatorMessage& message);
void loadTranslation();
// Tracks whether we are using an OpenGL-backed renderer or a Vulkan-backed renderer
bool usingGL = false;