Skip to content

Commit a404cc6

Browse files
Adds localization to most UI elements.
1 parent 4ac9f4e commit a404cc6

File tree

7 files changed

+163
-152
lines changed

7 files changed

+163
-152
lines changed

data/locale/en-US.ini

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
General.SaveButton="Save"
2+
General.CancelButton="Cancel"
3+
MarketplaceWindow.LoginButton.LogIn="Log In"
4+
MarketplaceWindow.LoginButton.LogOut="Sign Out"
5+
MarketplaceWindow.OpenSettingsButton.Tooltip="Open Settings"
6+
MarketplaceWindow.StoreButton.Tooltip="Go to Elgato Marketplace"
7+
MarketplaceWindow.DownloadButton.Tooltip="Click to Download"
8+
MarketplaceWindow.PurchasedTab="Purchased"
9+
MarketplaceWindow.Purchased.NoPurchasesTitle="You don't own any scene collection products yet"
10+
MarketplaceWindow.Purchased.NoPurchasesSubtitle="Your digital assets from Marketplace will appear here"
11+
MarketplaceWindow.LoginNeeded.Title="Please Log In"
12+
MarketplaceWindow.LoginNeeded.Subtitle="Click the Log In button above to log into your account and begin using the Elgato Marketplace plugin."
13+
MarketplaceWindow.ConnectionError.Title="Connection Error"
14+
MarketplaceWindow.ConnectionError.Subtitle="Could not connect to the server. (please check your network connection)"
15+
MarketplaceWindow.Loading.Title="Loading Your Purchased Products..."
16+
MarketplaceWindow.Settings.Title="Settings"
17+
MarketplaceWindow.Settings.DefaultVideoDevice.Label="Default Video Device"
18+
MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected="None Selected"
19+
MarketplaceWindow.Settings.DefaultVideoDevice.SettingsButton.Tooltip="Video Capture Device Settings"
20+
MarketplaceWindow.Settings.DefaultAudioDevice.Label="Default Audio Device"
21+
MarketplaceWindow.Settings.InstallLocation="Medial File Install Location"
22+
MarketplaceWindow.Settings.EnableMakerTools="Enable Maker Tools"
23+
MarketplaceWindow.Settings.MakerToolsRestartWarning.Disabled="Maker tools will be disabled after restarting OBS."
24+
MarketplaceWindow.Settings.MakerToolsRestartWarning.Enabled="Maker tools will be enabled after restarting OBS."
25+
MarketplaceWindow.DownloadProduct.NetworkError.Title="Network Connection Error"
26+
MarketplaceWindow.DownloadProduct.NetworkError.Subtitle="Could not connect to the Marketplace. Please try again."
27+
MarketplaceWindow.DownloadProduct.InvalidFiletype.Title="Invalid File Type"
28+
MarketplaceWindow.DownloadProduct.InvalidFiletype.Subtitle="File is not an .elgatoscene file."
29+
ExportWizard.NextButton="Next"
30+
ExportWizard.BackButton="Back"
31+
ExportWizard.CloseButton="Close"
32+
ExportWizard.MediaFileCheck.Title="Media File Check"
33+
ExportWizard.MediaFileCheck.Text=" media files were found to bundle.\nIf this is correct, click 'Next' below."
34+
ExportWizard.VideoSourceLabels.Title="Video Source Labels"
35+
ExportWizard.VideoSourceLabels.Text="Now go ahead and label your video sources."
36+
ExportWizard.VideoSourceLabels.InputPlaceholder="Description text goes here"
37+
ExportWizard.VideoSourceLabels.NoCaptureSourcesText="No video capture sources found."
38+
ExportWizard.RequiredPlugins.Title="Required Plug-ins"
39+
ExportWizard.RequiredPlugins.Text="Please select all plugins that are required to use this scene collection."
40+
ExportWizard.RequiredPlugins.NoPluginsFound="No installed plugins found."
41+
ExportWizard.ExportComplete.Title="Scene Bundle Exported"
42+
ExportWizard.ExportComplete.Text="Bundle successfully exported. Click 'Close' below to close this window."
43+
ExportWizard.Exporting.Title="Exporting Bundle..."
44+
ExportWizard.Exporting.Text="Note: this can take a few minutes for scene collections with large files."
45+
SetupWizard.WindowTitle="Install Scene Collection"
46+
SetupWizard.NextButton="Next"
47+
SetupWizard.BackButton="Back"
48+
SetupWizard.MissingPlugins.Title="Missing Plugins"
49+
SetupWizard.MissingPlugins.Text="The following plugins are required to use this scene collection, but are not installed. Please install these plugins, restart OBS and attempt to install again."
50+
SetupWizard.MissingPlugins.DownloadButton="Download"
51+
SetupWizard.SelectInstall.Title="Select Install"
52+
SetupWizard.SelectInstall.NewInstallButton="New"
53+
SetupWizard.SelectInstall.ExistingInstallButton="New"
54+
SetupWizard.CreateCollection.Title="Create Scene Collection"
55+
SetupWizard.CreateCollection.NewNamePlaceholder="Collection Name"
56+
SetupWziard.NameInUseError.Title="Name in use."
57+
SetupWizard.NameInUseError.Text="A scene collection already exists with this name. Please provide another name."
58+
SetupWizard.AudioSetup.Device.Text="Audio Device"
59+
SetupWizard.Loading.Title="Loading Collection..."
60+
SetupWizard.Loading.Text="Note: this can take some time for scene collections with large files."
61+
SetupWizard.IncompatibleFile.Title="Incompatible file"
62+
SetupWizard.IncompatibleFile.Text="Error: This download did not contain a valid bundleInfo.json file and cannot be installed. (note: this is a problem with the submitted scene collection file on the server)"

src/elgato-cloud-config.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ DefaultAVWidget::DefaultAVWidget(QWidget *parent) : QWidget(parent)
5757

5858
auto dropDowns = new QVBoxLayout();
5959

60-
auto videoSourceLabel = new QLabel("Default Video Device", this);
60+
auto videoSourceLabel = new QLabel(
61+
obs_module_text("MarketplaceWindow.Settings.DefaultVideoDevice.Label"), this);
6162
videoSourceLabel->setStyleSheet("font-size: 12pt;");
6263

63-
auto audioSourceLabel = new QLabel("Default Audio Device", this);
64+
auto audioSourceLabel = new QLabel(
65+
obs_module_text("MarketplaceWindow.Settings.DefaultAudioDevice.Label"), this);
6466
audioSourceLabel->setStyleSheet("font-size: 12pt;");
6567

6668
_videoSources = new QComboBox(this);
@@ -71,7 +73,8 @@ DefaultAVWidget::DefaultAVWidget(QWidget *parent) : QWidget(parent)
7173
_videoPreview->hide();
7274

7375
_blank = new QLabel(this);
74-
_blank->setText("None Selected");
76+
_blank->setText(
77+
obs_module_text("MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected"));
7578
_blank->setAlignment(Qt::AlignCenter);
7679
_blank->setFixedHeight(171);
7780
_blank->setFixedWidth(304);
@@ -98,7 +101,8 @@ DefaultAVWidget::DefaultAVWidget(QWidget *parent) : QWidget(parent)
98101
_settingsButton->setMaximumHeight(24);
99102
_settingsButton->setStyleSheet(settingsButtonStyle);
100103
_settingsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
101-
_settingsButton->setToolTip("Video Capture Device Settings");
104+
_settingsButton->setToolTip(
105+
obs_module_text("MarketplaceWindow.Settings.DefaultVideoDevice.SettingsButton.Tooltip"));
102106
connect(_settingsButton, &QPushButton::released, this, [this]() {
103107
obs_frontend_open_source_properties(_videoCaptureSource);
104108
});
@@ -306,13 +310,6 @@ void DefaultAVWidget::save()
306310

307311
void DefaultAVWidget::SetupVolMeter()
308312
{
309-
obs_log(LOG_INFO, "SetupVolMeter");
310-
//if (_volmeter) {
311-
// obs_volmeter_remove_callback(_volmeter,
312-
// AudioSetup::OBSVolumeLevel, this);
313-
// obs_volmeter_destroy(_volmeter);
314-
// _volmeter = nullptr;
315-
//}
316313
_volmeter = obs_volmeter_create(OBS_FADER_LOG);
317314
obs_volmeter_attach_source(_volmeter, _audioCaptureSource);
318315
obs_volmeter_add_callback(_volmeter, DefaultAVWidget::OBSVolumeLevel,
@@ -337,7 +334,6 @@ void DefaultAVWidget::OpenConfigAudioSource()
337334
for (size_t i = 0; i < obs_property_list_item_count(devices); i++) {
338335
std::string name = obs_property_list_item_name(devices, i);
339336
std::string id = obs_property_list_item_string(devices, i);
340-
obs_log(LOG_INFO, "--- MIC: %s [%s]", name.c_str(), id.c_str());
341337
}
342338
obs_properties_destroy(props);
343339
}
@@ -474,7 +470,8 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
474470
auto layout = new QVBoxLayout();
475471

476472
auto title = new QLabel(this);
477-
title->setText("Settings");
473+
title->setText(
474+
obs_module_text("MarketplaceWindow.Settings.Title"));
478475
title->setAlignment(Qt::AlignCenter);
479476
title->setStyleSheet("QLabel { font-size: 16pt; }");
480477
title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
@@ -486,7 +483,8 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
486483
layout->addWidget(_avWidget);
487484

488485
// Theme installation location setting
489-
auto filePickerLabel = new QLabel("Install Location", this);
486+
auto filePickerLabel = new QLabel(
487+
obs_module_text("MarketplaceWindow.Settings.InstallLocation"), this);
490488
filePickerLabel->setStyleSheet("margin-left: 16px; font-size: 12pt;");
491489

492490
auto config = elgatoCloud->GetConfig();
@@ -511,7 +509,8 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
511509
connect(directoryPick, &QPushButton::released, this,
512510
[this, directory]() {
513511
QFileDialog *dialog =
514-
new QFileDialog(this, "Install Directory",
512+
new QFileDialog(this,
513+
obs_module_text("MarketplaceWindow.Settings.InstallLocation"),
515514
_installDirectory.c_str());
516515
dialog->setFileMode(QFileDialog::Directory);
517516
//dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -540,7 +539,8 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
540539

541540
// Maker Tools toggle.
542541
bool makerTools = obs_data_get_bool(config, "MakerTools");
543-
_makerCheckbox = new QCheckBox("Enable Maker Tools", this);
542+
_makerCheckbox = new QCheckBox(
543+
obs_module_text("MarketplaceWindow.Settings.EnableMakerTools"), this);
544544
_makerCheckbox->setChecked(makerTools);
545545
std::string checkedImage = imageBaseDir + "checkbox_checked.png";
546546
std::string uncheckedImage = imageBaseDir + "checkbox_unchecked.png";
@@ -555,7 +555,7 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
555555
_makerRestartMsg->setVisible(makerTools != elgatoCloud->MakerToolsOnStart());
556556
});
557557

558-
std::string restartTxt = elgatoCloud->MakerToolsOnStart() ? "Maker tools will be disabled after restarting OBS." : "Maker tools will be enabled after restarting OBS.";
558+
std::string restartTxt = elgatoCloud->MakerToolsOnStart() ? obs_module_text("MarketplaceWindow.Settings.MakerToolsRestartWarning.Disabled") : obs_module_text("MarketplaceWindow.Settings.MakerToolsRestartWarning.Enabled");
559559
_makerRestartMsg = new QLabel(restartTxt.c_str(), this);
560560
_makerRestartMsg->setVisible(false);
561561
_makerRestartMsg->setStyleSheet(
@@ -572,11 +572,13 @@ ElgatoCloudConfig::ElgatoCloudConfig(QWidget *parent) : QDialog(parent)
572572
auto buttons = new QHBoxLayout();
573573

574574
QPushButton *cancelButton = new QPushButton(this);
575-
cancelButton->setText("Cancel");
575+
cancelButton->setText(
576+
obs_module_text("General.CancelButton"));
576577
cancelButton->setStyleSheet(EPushButtonCancelStyle);
577578

578579
QPushButton *saveButton = new QPushButton(this);
579-
saveButton->setText("Save");
580+
saveButton->setText(
581+
obs_module_text("General.SaveButton"));
580582
saveButton->setStyleSheet(EPushButtonStyle);
581583

582584
buttons->addStretch();
@@ -613,8 +615,6 @@ void ElgatoCloudConfig::OpenConfigVideoSource()
613615
for (size_t i = 0; i < obs_property_list_item_count(devices); i++) {
614616
std::string name = obs_property_list_item_name(devices, i);
615617
std::string id = obs_property_list_item_string(devices, i);
616-
obs_log(LOG_INFO, "--- VIDEO: %s [%s]", name.c_str(),
617-
id.c_str());
618618
}
619619
obs_properties_destroy(props);
620620
}

src/elgato-cloud-window.cpp

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ DownloadButton::DownloadButton(QWidget *parent) : QWidget(parent)
100100
QSizePolicy::Preferred);
101101

102102
_downloadButton = new QPushButton(this);
103-
_downloadButton->setToolTip("Click to Download");
103+
_downloadButton->setToolTip(obs_module_text("MarketplaceWindow.DownloadButton.Tooltip"));
104104
std::string downloadIconPath = imageBaseDir + "download.svg";
105105
std::string downloadIconHoverPath = imageBaseDir + "download_hover.svg";
106106
blog(LOG_INFO, "download img: ", downloadIconPath.c_str());
@@ -245,7 +245,7 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
245245
_layout->addStretch();
246246

247247
_settingsButton = new QPushButton(this);
248-
_settingsButton->setToolTip("Settings");
248+
_settingsButton->setToolTip(obs_module_text("MarketplaceWindow.OpenSettingsButton.Tooltip"));
249249
std::string settingsIconPath = imageBaseDir + "settings.svg";
250250
std::string settingsIconHoverPath = imageBaseDir + "settings_hover.svg";
251251
QString settingsButtonStyle = EIconHoverButtonStyle;
@@ -262,7 +262,7 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
262262
_layout->addWidget(_settingsButton);
263263

264264
_storeButton = new QPushButton(this);
265-
_storeButton->setToolTip("Go to Elgato Marketplace");
265+
_storeButton->setToolTip(obs_module_text("MarketplaceWindow.StoreButton.Tooltip"));
266266
std::string storeIconPath = imageBaseDir + "marketplace-logo.svg";
267267
std::string storeIconHoverPath =
268268
imageBaseDir + "marketplace-logo_hover.svg";
@@ -281,7 +281,7 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
281281
_layout->addWidget(_storeButton);
282282

283283
_logInButton = new QPushButton(this);
284-
_logInButton->setText("Log In");
284+
_logInButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
285285
_logInButton->setHidden(elgatoCloud->loggedIn);
286286
_logInButton->setStyleSheet(
287287
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -291,7 +291,7 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
291291
[this]() { elgatoCloud->StartLogin(); });
292292

293293
_logOutButton = new QPushButton(this);
294-
_logOutButton->setText("Sign Out");
294+
_logOutButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogOut"));
295295
_logOutButton->setHidden(!elgatoCloud->loggedIn);
296296
_logOutButton->setStyleSheet(
297297
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -381,7 +381,7 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
381381
{
382382
_layout = new QHBoxLayout(this);
383383
_sideMenu = new QListWidget(this);
384-
_sideMenu->addItem("Purchased");
384+
_sideMenu->addItem(obs_module_text("MarketplaceWindow.PurchasedTab"));
385385
//_sideMenu->addItem("Installed (#)");
386386
_sideMenu->setSizePolicy(QSizePolicy::Preferred,
387387
QSizePolicy::Expanding);
@@ -391,7 +391,7 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
391391
connect(_sideMenu, &QListWidget::itemPressed, this,
392392
[this](QListWidgetItem *item) {
393393
QString val = item->text();
394-
if (val == "Purchased") {
394+
if (val == obs_module_text("MarketplaceWindow.PurchasedTab")) {
395395
if (_numProducts > 0)
396396
_content->setCurrentIndex(0);
397397
else
@@ -417,12 +417,12 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
417417
auto npLayout = new QVBoxLayout(noProducts);
418418
npLayout->addStretch();
419419
auto npTitle = new QLabel(
420-
"You don't own any scene collection products yet", noProducts);
420+
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesTitle"), noProducts);
421421
npTitle->setStyleSheet("QLabel {font-size: 18pt;}");
422422
npTitle->setAlignment(Qt::AlignCenter);
423423
npLayout->addWidget(npTitle);
424424
auto npSubTitle = new QLabel(
425-
"Your digital assets from Marketplace will appear here",
425+
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesSubtitle"),
426426
noProducts);
427427
npSubTitle->setStyleSheet("QLabel {font-size: 13pt;}");
428428
npSubTitle->setAlignment(Qt::AlignCenter);
@@ -469,7 +469,7 @@ ElgatoCloudWindow::~ElgatoCloudWindow()
469469

470470
void ElgatoCloudWindow::initialize()
471471
{
472-
setWindowTitle(QString("Elgato Marketplace"));
472+
setWindowTitle(QString("Elgato Marketplace Connect"));
473473
setFixedSize(1140, 600);
474474

475475
QPalette pal = QPalette();
@@ -509,18 +509,11 @@ void ElgatoCloudWindow::initialize()
509509

510510
auto loadingWidget = new LoadingWidget(this); // Loading widget, id: 3
511511
_stackedContent->addWidget(loadingWidget);
512-
//_config = new ElgatoCloudConfig(this);
513-
//_config->setVisible(false);
514-
//connect(_config, &ElgatoCloudConfig::closeClicked, this, [this]() {
515-
// //_mainWidget->setVisible(true);
516-
// //_config->setVisible(false);
517-
//});
518512

519513
mainLayout->addWidget(_stackedContent);
520514
_mainWidget->setLayout(mainLayout);
521515

522516
_layout->addWidget(_mainWidget);
523-
//_layout->addWidget(_config);
524517

525518
setLayout(_layout);
526519
}
@@ -590,7 +583,7 @@ ElgatoProductItem::ElgatoProductItem(QWidget *parent, ElgatoProduct *product)
590583
label->setStyleSheet("QLabel {font-size: 11pt;}");
591584

592585
titleLayout->addWidget(label);
593-
auto subTitle = new QLabel("Stream Package", this);
586+
auto subTitle = new QLabel("Scene Collection", this);
594587
subTitle->setStyleSheet("QLabel {font-size: 10pt; color: #7E7E7E; }");
595588
titleLayout->addWidget(subTitle);
596589

@@ -698,13 +691,12 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
698691
auto layout = new QVBoxLayout(this);
699692

700693
auto login = new QLabel(this);
701-
login->setText("Please Log In");
694+
login->setText(obs_module_text("MarketplaceWindow.LoginNeeded.Title"));
702695
login->setStyleSheet("QLabel {font-size: 18pt;}");
703696
login->setAlignment(Qt::AlignCenter);
704697

705698
auto loginSub = new QLabel(this);
706-
loginSub->setText(
707-
"Click the Log In button above to log into your account and begin using the Elgato Marketplace plugin.");
699+
loginSub->setText(obs_module_text("MarketplaceWindow.LoginNeeded.Subtitle"));
708700
loginSub->setWordWrap(true);
709701
loginSub->setAlignment(Qt::AlignCenter);
710702

@@ -719,14 +711,14 @@ ConnectionError::ConnectionError(QWidget *parent) : QWidget(parent)
719711
auto layout = new QVBoxLayout(this);
720712

721713
auto connectionError = new QLabel(this);
722-
connectionError->setText("Connection Error");
714+
connectionError->setText(
715+
obs_module_text("MarketplaceWindow.ConnectionError.Title"));
723716
connectionError->setStyleSheet("QLabel {font-size: 18pt;}");
724717
connectionError->setAlignment(Qt::AlignCenter);
725718

726719
auto connectionErrorSub = new QLabel(this);
727-
// TODO- CHANGE THIS TEXT IF NOT INTERNAL
728720
connectionErrorSub->setText(
729-
"Could not connect to the server. (make sure you are using the VPN to connect to staging)");
721+
obs_module_text("MarketplaceWindow.ConnectionError.Subtitle"));
730722
connectionErrorSub->setWordWrap(true);
731723
connectionErrorSub->setAlignment(Qt::AlignCenter);
732724

@@ -740,7 +732,7 @@ LoadingWidget::LoadingWidget(QWidget *parent) : QWidget(parent)
740732
{
741733
auto layout = new QVBoxLayout(this);
742734
auto loading = new QLabel(this);
743-
loading->setText("Loading Your Purchased Products...");
735+
loading->setText(obs_module_text("MarketplaceWindow.Loading.Title"));
744736
loading->setStyleSheet("QLabel {font-size: 18pt;}");
745737
loading->setAlignment(Qt::AlignCenter);
746738

0 commit comments

Comments
 (0)