GUI: OPTIONS: Cloud storage list populated with translated string on addCloudControls()

Resolves a bug with displaying the wrong (previous) translation when switch theme language

Previously, a translated string was stored in cloudmanager _storages config items, which would become stale if the theme language was changed.
This commit is contained in:
Thanasis Antoniou 2020-02-09 21:55:36 +02:00
parent 469a242555
commit f971e1e4a8
2 changed files with 5 additions and 4 deletions

View file

@ -94,7 +94,7 @@ void CloudManager::init() {
for (uint32 i = 0; i < kStorageTotal; ++i) {
Common::String name = getStorageConfigName(i);
StorageConfig config;
config.name = _(name);
config.name = name;
config.username = "";
config.lastSyncDate = "";
config.usedBytes = 0;
@ -312,7 +312,7 @@ void CloudManager::disconnectStorage(uint32 index) {
ConfMan.removeKey(kStoragePrefix + name + "_usedBytes", ConfMan.kCloudDomain);
StorageConfig config;
config.name = _(name);
config.name = name;
config.username = "";
config.lastSyncDate = "";
config.usedBytes = 0;

View file

@ -1965,8 +1965,9 @@ void GlobalOptionsDialog::addCloudControls(GuiObject *boss, const Common::String
_storagePopUpDesc = new StaticTextWidget(boss, prefix + "StoragePopupDesc", _("Active storage:"), _("Active cloud storage"));
_storagePopUp = new PopUpWidget(boss, prefix + "StoragePopup");
Common::StringArray list = CloudMan.listStorages();
for (uint32 i = 0; i < list.size(); ++i)
_storagePopUp->appendEntry(list[i], i);
for (uint32 i = 0; i < list.size(); ++i) {
_storagePopUp->appendEntry(_(list[i]), i);
}
_storagePopUp->setSelected(_selectedStorageIndex);
if (lowres)