From 15c983a3822e2e51ba6aef97df8e8203f3cc9f2a Mon Sep 17 00:00:00 2001 From: vnctdj Date: Wed, 16 Aug 2017 23:39:30 +0200 Subject: [PATCH] Add a new translation category for the remote ISO feature --- UI/RemoteISOScreen.cpp | 45 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index 09603b7d29..39a04f157e 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -371,8 +371,7 @@ void RemoteISOScreen::update() { void RemoteISOScreen::CreateViews() { I18NCategory *di = GetI18NCategory("Dialog"); - I18NCategory *pa = GetI18NCategory("Pause"); - I18NCategory *sy = GetI18NCategory("System"); + I18NCategory *ri = GetI18NCategory("RemoteISO"); Margins actionMenuMargins(0, 20, 15, 0); Margins contentMargins(0, 20, 5, 5); @@ -381,24 +380,24 @@ void RemoteISOScreen::CreateViews() { ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins)); LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL); - leftColumnItems->Add(new TextView(sy->T("RemoteISODesc", "Games in your recent list will be shared"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); - leftColumnItems->Add(new TextView(sy->T("RemoteISOWifi", "Note: Connect both devices to the same wifi"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); + leftColumnItems->Add(new TextView(ri->T("RemoteISODesc", "Games in your recent list will be shared"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); + leftColumnItems->Add(new TextView(ri->T("RemoteISOWifi", "Note: Connect both devices to the same wifi"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); rightColumnItems->SetSpacing(0.0f); - Choice *browseChoice = new Choice(sy->T("Browse Games")); + Choice *browseChoice = new Choice(ri->T("Browse Games")); rightColumnItems->Add(browseChoice)->OnClick.Handle(this, &RemoteISOScreen::HandleBrowse); ServerStatus status = RetrieveStatus(); if (status == ServerStatus::STOPPING) { - rightColumnItems->Add(new Choice(sy->T("Stopping..")))->SetDisabledPtr(&serverStopping_); + rightColumnItems->Add(new Choice(ri->T("Stopping..")))->SetDisabledPtr(&serverStopping_); browseChoice->SetEnabled(false); } else if (status != ServerStatus::STOPPED) { - rightColumnItems->Add(new Choice(sy->T("Stop Sharing")))->OnClick.Handle(this, &RemoteISOScreen::HandleStopServer); + rightColumnItems->Add(new Choice(ri->T("Stop Sharing")))->OnClick.Handle(this, &RemoteISOScreen::HandleStopServer); browseChoice->SetEnabled(false); } else { - rightColumnItems->Add(new Choice(sy->T("Share Games (Server)")))->OnClick.Handle(this, &RemoteISOScreen::HandleStartServer); + rightColumnItems->Add(new Choice(ri->T("Share Games (Server)")))->OnClick.Handle(this, &RemoteISOScreen::HandleStartServer); browseChoice->SetEnabled(true); } - Choice *settingsChoice = new Choice(pa->T("Settings")); + Choice *settingsChoice = new Choice(ri->T("Settings")); rightColumnItems->Add(settingsChoice)->OnClick.Handle(this, &RemoteISOScreen::HandleSettings); LinearLayout *beforeBack = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT)); @@ -476,7 +475,7 @@ RemoteISOConnectScreen::~RemoteISOConnectScreen() { void RemoteISOConnectScreen::CreateViews() { I18NCategory *di = GetI18NCategory("Dialog"); - I18NCategory *sy = GetI18NCategory("System"); + I18NCategory *ri = GetI18NCategory("RemoteISO"); Margins actionMenuMargins(0, 20, 15, 0); Margins contentMargins(0, 20, 5, 5); @@ -485,7 +484,7 @@ void RemoteISOConnectScreen::CreateViews() { ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins)); LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL); - statusView_ = leftColumnItems->Add(new TextView(sy->T("RemoteISOScanning", "Scanning... click Share Games on your desktop"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); + statusView_ = leftColumnItems->Add(new TextView(ri->T("RemoteISOScanning", "Scanning... click Share Games on your desktop"), new LinearLayoutParams(Margins(12, 5, 0, 5)))); rightColumnItems->SetSpacing(0.0f); rightColumnItems->Add(new Choice(di->T("Cancel"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); @@ -499,7 +498,7 @@ void RemoteISOConnectScreen::CreateViews() { } void RemoteISOConnectScreen::update() { - I18NCategory *sy = GetI18NCategory("System"); + I18NCategory *ri = GetI18NCategory("RemoteISO"); UIScreenWithBackground::update(); @@ -510,7 +509,7 @@ void RemoteISOConnectScreen::update() { break; case ScanStatus::FOUND: - statusView_->SetText(sy->T("RemoteISOLoading", "Connected - loading game list")); + statusView_->SetText(ri->T("RemoteISOLoading", "Connected - loading game list")); status_ = ScanStatus::LOADING; // Let's reuse scanThread_. @@ -601,7 +600,7 @@ void RemoteISOBrowseScreen::CreateViews() { bool vertical = UseVerticalLayout(); I18NCategory *di = GetI18NCategory("Dialog"); - I18NCategory *n = GetI18NCategory("Networking"); + I18NCategory *ri = GetI18NCategory("RemoteISO"); Margins actionMenuMargins(0, 10, 10, 0); @@ -620,7 +619,7 @@ void RemoteISOBrowseScreen::CreateViews() { scrollRecentGames->Add(tabRemoteGames); gameBrowsers_.push_back(tabRemoteGames); - leftColumn->AddTab(n->T("Remote Server"), scrollRecentGames); + leftColumn->AddTab(ri->T("Remote Server"), scrollRecentGames); tabRemoteGames->OnChoice.Handle(this, &MainScreen::OnGameSelectedInstant); tabRemoteGames->OnHoldChoice.Handle(this, &MainScreen::OnGameSelected); tabRemoteGames->OnHighlight.Handle(this, &MainScreen::OnGameHighlight); @@ -666,9 +665,7 @@ void RemoteISOSettingsScreen::update() { } void RemoteISOSettingsScreen::CreateViews() { - I18NCategory *di = GetI18NCategory("Dialog"); - I18NCategory *n = GetI18NCategory("Networking"); - I18NCategory *sy = GetI18NCategory("System"); + I18NCategory *ri = GetI18NCategory("RemoteISO"); ViewGroup *remoteisoSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT)); remoteisoSettingsScroll->SetTag("RemoteISOSettings"); @@ -676,17 +673,17 @@ void RemoteISOSettingsScreen::CreateViews() { remoteisoSettings->SetSpacing(0); remoteisoSettingsScroll->Add(remoteisoSettings); - remoteisoSettings->Add(new ItemHeader(sy->T("Remote disc streaming"))); - remoteisoSettings->Add(new CheckBox(&g_Config.bRemoteISOManual, n->T("Manual Mode Client", "Manual Mode Client"))); - PopupTextInputChoice *remoteServer = remoteisoSettings->Add(new PopupTextInputChoice(&g_Config.sLastRemoteISOServer, n->T("Remote Server"), "", 255, screenManager())); + remoteisoSettings->Add(new ItemHeader(ri->T("Remote disc streaming"))); + remoteisoSettings->Add(new CheckBox(&g_Config.bRemoteISOManual, ri->T("Manual Mode Client", "Manual Mode Client"))); + PopupTextInputChoice *remoteServer = remoteisoSettings->Add(new PopupTextInputChoice(&g_Config.sLastRemoteISOServer, ri->T("Remote Server"), "", 255, screenManager())); remoteServer->SetEnabledPtr(&g_Config.bRemoteISOManual); - PopupSliderChoice *remotePort = remoteisoSettings->Add(new PopupSliderChoice(&g_Config.iLastRemoteISOPort, 0, 65535, n->T("Remote Port", "Remote Port"), 100, screenManager())); + PopupSliderChoice *remotePort = remoteisoSettings->Add(new PopupSliderChoice(&g_Config.iLastRemoteISOPort, 0, 65535, ri->T("Remote Port", "Remote Port"), 100, screenManager())); remotePort->SetEnabledPtr(&g_Config.bRemoteISOManual); - PopupTextInputChoice *remoteSubdir = remoteisoSettings->Add(new PopupTextInputChoice(&g_Config.sRemoteISOSubdir, n->T("Remote Subdirectory"), "", 255, screenManager())); + PopupTextInputChoice *remoteSubdir = remoteisoSettings->Add(new PopupTextInputChoice(&g_Config.sRemoteISOSubdir, ri->T("Remote Subdirectory"), "", 255, screenManager())); remoteSubdir->SetEnabledPtr(&g_Config.bRemoteISOManual); remoteSubdir->OnChange.Handle(this, &RemoteISOSettingsScreen::OnChangeRemoteISOSubdir); - PopupSliderChoice *portChoice = new PopupSliderChoice(&g_Config.iRemoteISOPort, 0, 65535, n->T("Local Server Port", "Local Server Port"), 100, screenManager()); + PopupSliderChoice *portChoice = new PopupSliderChoice(&g_Config.iRemoteISOPort, 0, 65535, ri->T("Local Server Port", "Local Server Port"), 100, screenManager()); remoteisoSettings->Add(portChoice); portChoice->SetDisabledPtr(&serverRunning_); remoteisoSettings->Add(new Spacer(25.0));