Browse Source

Fix pfLocalizationDataMgr's SetElementPlainTextData to work properly

without a database re-load.
Michael Hansen 11 years ago
parent
commit
f0ed701d8f
  1. 3
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp
  2. 5
      Sources/Tools/plLocalizationEditor/plEditDlg.cpp

3
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp

@ -157,7 +157,8 @@ void pfLocalizedString::IParameterize(const plString & inString)
void pfLocalizedString::IConvertFromPlainText(const plString & plainText)
{
IParameterize(plainText);
fPlainTextRep = plainText;
IParameterize(fPlainTextRep);
IUpdateXML();
}

5
Sources/Tools/plLocalizationEditor/plEditDlg.cpp

@ -116,6 +116,9 @@ void EditDialog::SaveLocalizationText()
plString ageName, setName, elementName, elementLanguage;
SplitLocalizationPath(fCurrentLocPath, ageName, setName, elementName, elementLanguage);
if (ageName.IsEmpty() || setName.IsEmpty() || elementName.IsEmpty() || elementLanguage.IsEmpty())
return;
plString name = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str());
pfLocalizationDataMgr::Instance().SetElementPlainTextData(name, elementLanguage, text);
}
@ -351,7 +354,7 @@ void EditDialog::DeleteClicked()
QMessageBox::critical(this, tr("Error"), tr("Couldn't delete localization!"));
else
{
plString path = fCurrentLocPath;
plString path = key + ".English";
fCurrentLocPath = "";
fUI->fLocalizationTree->clear();
fUI->fLocalizationTree->LoadData(path);

Loading…
Cancel
Save