diff --git a/src/Main/XLIFFParser.cxx b/src/Main/XLIFFParser.cxx index c16d409fa..a11902346 100644 --- a/src/Main/XLIFFParser.cxx +++ b/src/Main/XLIFFParser.cxx @@ -21,6 +21,7 @@ #include "XLIFFParser.hxx" #include +#include // simgear #include @@ -121,7 +122,8 @@ void XLIFFParser::finishTransUnit() } const auto id = _unitId.substr(slashPos + 1, indexPos - (slashPos + 1)); - _resourceNode->setStringValue(id, _target); + const int index = std::stoi(_unitId.substr(indexPos+1)); + _resourceNode->getNode(id, index, true)->setStringValue(_target); } void XLIFFParser::data (const char * s, int len) diff --git a/src/Main/locale.cxx b/src/Main/locale.cxx index e25ac9193..2b2edbb3f 100644 --- a/src/Main/locale.cxx +++ b/src/Main/locale.cxx @@ -320,8 +320,7 @@ FGLocale::loadResource(const char* resource) bool Ok = loadResource(_defaultLocale, resource); // also load language specific resource, unless identical - if ((_currentLocale!=0)&& - (_defaultLocale != _currentLocale)) + if ((_currentLocale != nullptr) && (_defaultLocale != _currentLocale)) { Ok &= loadResource(_currentLocale, resource); }