From 2a2af3a81cb58beec322dd4f766bf330f943f43e Mon Sep 17 00:00:00 2001 From: vnctdj <3978690+vnctdj@users.noreply.github.com> Date: Mon, 23 Mar 2020 22:39:09 +0100 Subject: [PATCH] Fix translation things --- UI/ChatScreen.cpp | 10 ++++---- UI/EmuScreen.cpp | 21 +++++++++-------- UI/GameSettingsScreen.cpp | 48 +++++++++++++++++++-------------------- 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/UI/ChatScreen.cpp b/UI/ChatScreen.cpp index 6a57177606..aa5478befe 100644 --- a/UI/ChatScreen.cpp +++ b/UI/ChatScreen.cpp @@ -41,11 +41,11 @@ void ChatMenu::CreatePopupContents(UI::ViewGroup *parent) { if (g_Config.bEnableQuickChat) { LinearLayout *quickChat = outer->Add(new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT))); - quickChat->Add(new Button(n->T("1"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat1); - quickChat->Add(new Button(n->T("2"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat2); - quickChat->Add(new Button(n->T("3"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat3); - quickChat->Add(new Button(n->T("4"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat4); - quickChat->Add(new Button(n->T("5"), new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat5); + quickChat->Add(new Button("1", new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat1); + quickChat->Add(new Button("2", new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat2); + quickChat->Add(new Button("3", new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat3); + quickChat->Add(new Button("4", new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat4); + quickChat->Add(new Button("5", new LinearLayoutParams(1.0)))->OnClick.Handle(this, &ChatMenu::OnQuickChat5); } chatVert_ = scroll_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); chatVert_->SetSpacing(0); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 09e431a8c1..2bdb212a3f 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1013,8 +1013,9 @@ protected: void EmuScreen::CreateViews() { using namespace UI; - auto sc = GetI18NCategory("Screen"); auto dev = GetI18NCategory("Developer"); + auto n = GetI18NCategory("Networking"); + auto sc = GetI18NCategory("Screen"); const Bounds &bounds = screenManager()->getUIContext()->GetBounds(); InitPadLayout(bounds.w, bounds.h); @@ -1030,31 +1031,31 @@ void EmuScreen::CreateViews() { if (g_Config.bEnableNetworkChat) { switch (g_Config.iChatButtonPosition) { case 0: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, NONE, NONE, 50, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, NONE, NONE, 50, true)); break; case 1: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, bounds.centerX(), NONE, NONE, 50, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, bounds.centerX(), NONE, NONE, 50, true)); break; case 2: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, NONE, 80, 50, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, NONE, 80, 50, true)); break; case 3: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, 50, NONE, NONE, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, 50, NONE, NONE, true)); break; case 4: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, bounds.centerX(), 50, NONE, NONE, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, bounds.centerX(), 50, NONE, NONE, true)); break; case 5: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, 50, 80, NONE, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, 50, 80, NONE, true)); break; case 6: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, bounds.centerY(), NONE, NONE, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, bounds.centerY(), NONE, NONE, true)); break; case 7: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, bounds.centerY(), 80, NONE, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, NONE, bounds.centerY(), 80, NONE, true)); break; default: - chatButtons = new ChoiceWithValueDisplay(&newChat, sc->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, NONE, NONE, 50, true)); + chatButtons = new ChoiceWithValueDisplay(&newChat, n->T("Chat"), new AnchorLayoutParams(130, WRAP_CONTENT, 80, NONE, NONE, 50, true)); break; } diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index dc139e0353..c429d0cff0 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -685,56 +685,55 @@ void GameSettingsScreen::CreateViews() { networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sMACAddress, n->T("Change Mac Address"), (const char *)nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeMacAddress); networkingSettings->Add(new PopupSliderChoice(&g_Config.iPortOffset, 0, 60000, n->T("Port offset", "Port offset(0 = PSP compatibility)"), 100, screenManager())); - - networkingSettings->Add(new ItemHeader(ms->T("Chat"))); + networkingSettings->Add(new ItemHeader(n->T("Chat"))); networkingSettings->Add(new CheckBox(&g_Config.bEnableNetworkChat, n->T("Enable network chat", "Enable network chat"))); - static const char *chatButtonPositions[] = { "Bottom Left", "Bottom Center","Bottom Right","Top Left","Top Center", "Top Right","Center Left","Center Right" }; - networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatButtonPosition, n->T("Chat Button Position"), chatButtonPositions, 0, ARRAY_SIZE(chatButtonPositions), "Chat Button Position", screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat); - static const char *chatScreenPositions[] = { "Bottom Left", "Bottom Center","Bottom Right","Top Left","Top Center", "Top Right" }; - networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatScreenPosition, n->T("Chat Screen Position"), chatScreenPositions, 0, ARRAY_SIZE(chatScreenPositions), "Chat Screen Position", screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat); - networkingSettings->Add(new ItemHeader(co->T("QuickChat", "Quick Chat"))); - networkingSettings->Add(new CheckBox(&g_Config.bEnableQuickChat, co->T("QuickChat", "Enable Quick Chat"))); + static const char *chatButtonPositions[] = { "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right" }; + networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatButtonPosition, n->T("Chat Button Position"), chatButtonPositions, 0, ARRAY_SIZE(chatButtonPositions), n->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat); + static const char *chatScreenPositions[] = { "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right" }; + networkingSettings->Add(new PopupMultiChoice(&g_Config.iChatScreenPosition, n->T("Chat Screen Position"), chatScreenPositions, 0, ARRAY_SIZE(chatScreenPositions), n->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bEnableNetworkChat); + networkingSettings->Add(new ItemHeader(n->T("QuickChat", "Quick Chat"))); + networkingSettings->Add(new CheckBox(&g_Config.bEnableQuickChat, n->T("QuickChat", "Enable Quick Chat"))); #if !defined(MOBILE_DEVICE) && !defined(USING_QT_UI) // TODO: Add all platforms where KEY_CHAR support is added - PopupTextInputChoice *qc1 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat0, sy->T("Quick Chat 1"), "", 32, screenManager())); + PopupTextInputChoice *qc1 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat0, n->T("Quick Chat 1"), "", 32, screenManager())); qc1->SetEnabledPtr(&g_Config.bEnableQuickChat); - PopupTextInputChoice *qc2 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat1, sy->T("Quick Chat 2"), "", 32, screenManager())); + PopupTextInputChoice *qc2 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat1, n->T("Quick Chat 2"), "", 32, screenManager())); qc2->SetEnabledPtr(&g_Config.bEnableQuickChat); - PopupTextInputChoice *qc3 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat2, sy->T("Quick Chat 3"), "", 32, screenManager())); + PopupTextInputChoice *qc3 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat2, n->T("Quick Chat 3"), "", 32, screenManager())); qc3->SetEnabledPtr(&g_Config.bEnableQuickChat); - PopupTextInputChoice *qc4 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat3, sy->T("Quick Chat 4"), "", 32, screenManager())); + PopupTextInputChoice *qc4 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat3, n->T("Quick Chat 4"), "", 32, screenManager())); qc4->SetEnabledPtr(&g_Config.bEnableQuickChat); - PopupTextInputChoice *qc5 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat4, sy->T("Quick Chat 5"), "", 32, screenManager())); + PopupTextInputChoice *qc5 = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sQuickChat4, n->T("Quick Chat 5"), "", 32, screenManager())); qc5->SetEnabledPtr(&g_Config.bEnableQuickChat); #elif defined(USING_QT_UI) - Choice *qc1 = networkingSettings->Add(new Choice(sy->T("Quick Chat 1"))); + Choice *qc1 = networkingSettings->Add(new Choice(n->T("Quick Chat 1"))); qc1->SetEnabledPtr(&g_Config.bEnableQuickChat); qc1->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat0); - Choice *qc2 = networkingSettings->Add(new Choice(sy->T("Quick Chat 2"))); + Choice *qc2 = networkingSettings->Add(new Choice(n->T("Quick Chat 2"))); qc2->SetEnabledPtr(&g_Config.bEnableQuickChat); qc2->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat1); - Choice *qc3 = networkingSettings->Add(new Choice(sy->T("Quick Chat 3"))); + Choice *qc3 = networkingSettings->Add(new Choice(n->T("Quick Chat 3"))); qc3->SetEnabledPtr(&g_Config.bEnableQuickChat); qc3->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat2); - Choice *qc4 = networkingSettings->Add(new Choice(sy->T("Quick Chat 4"))); + Choice *qc4 = networkingSettings->Add(new Choice(n->T("Quick Chat 4"))); qc4->SetEnabledPtr(&g_Config.bEnableQuickChat); qc4->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat3); - Choice *qc5 = networkingSettings->Add(new Choice(sy->T("Quick Chat 5"))); + Choice *qc5 = networkingSettings->Add(new Choice(n->T("Quick Chat 5"))); qc5->SetEnabledPtr(&g_Config.bEnableQuickChat); qc5->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat4); #elif defined(__ANDROID__) - ChoiceWithValueDisplay *qc1 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat0, sy->T("Quick Chat 1"), (const char *)nullptr)); + ChoiceWithValueDisplay *qc1 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat0, n->T("Quick Chat 1"), (const char *)nullptr)); qc1->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat0); qc1->SetEnabledPtr(&g_Config.bEnableQuickChat); - ChoiceWithValueDisplay *qc2 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat1, sy->T("Quick Chat 2"), (const char *)nullptr)); + ChoiceWithValueDisplay *qc2 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat1, n->T("Quick Chat 2"), (const char *)nullptr)); qc2->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat1); qc2->SetEnabledPtr(&g_Config.bEnableQuickChat); - ChoiceWithValueDisplay *qc3 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat2, sy->T("Quick Chat 3"), (const char *)nullptr)); + ChoiceWithValueDisplay *qc3 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat2, n->T("Quick Chat 3"), (const char *)nullptr)); qc3->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat2); qc3->SetEnabledPtr(&g_Config.bEnableQuickChat); - ChoiceWithValueDisplay *qc4 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat3, sy->T("Quick Chat 4"), (const char *)nullptr)); + ChoiceWithValueDisplay *qc4 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat3, n->T("Quick Chat 4"), (const char *)nullptr)); qc4->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat3); qc4->SetEnabledPtr(&g_Config.bEnableQuickChat); - ChoiceWithValueDisplay *qc5 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat4, sy->T("Quick Chat 5"), (const char *)nullptr)); + ChoiceWithValueDisplay *qc5 = networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sQuickChat4, n->T("Quick Chat 5"), (const char *)nullptr)); qc5->OnClick.Handle(this, &GameSettingsScreen::OnChangeQuickChat4); qc5->SetEnabledPtr(&g_Config.bEnableQuickChat); #endif @@ -1364,8 +1363,7 @@ UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParam auto sy = GetI18NCategory("System"); #if defined(__ANDROID__) - auto n = GetI18NCategory("Networking"); - System_InputBoxGetString(n->T("IP"), g_Config.proAdhocServer, [](bool result, const std::string &value) { + System_InputBoxGetString(sy->T("proAdhocServer Address:"), g_Config.proAdhocServer, [](bool result, const std::string &value) { if (result) { g_Config.proAdhocServer = value; }