XLIFF: Fix loading of indexed strings
This commit is contained in:
parent
2313f482a3
commit
49c3fc064a
2 changed files with 4 additions and 3 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "XLIFFParser.hxx"
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
// simgear
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue