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 "XLIFFParser.hxx"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
// simgear
|
// simgear
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
|
@ -121,7 +122,8 @@ void XLIFFParser::finishTransUnit()
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto id = _unitId.substr(slashPos + 1, indexPos - (slashPos + 1));
|
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)
|
void XLIFFParser::data (const char * s, int len)
|
||||||
|
|
|
@ -320,8 +320,7 @@ FGLocale::loadResource(const char* resource)
|
||||||
bool Ok = loadResource(_defaultLocale, resource);
|
bool Ok = loadResource(_defaultLocale, resource);
|
||||||
|
|
||||||
// also load language specific resource, unless identical
|
// also load language specific resource, unless identical
|
||||||
if ((_currentLocale!=0)&&
|
if ((_currentLocale != nullptr) && (_defaultLocale != _currentLocale))
|
||||||
(_defaultLocale != _currentLocale))
|
|
||||||
{
|
{
|
||||||
Ok &= loadResource(_currentLocale, resource);
|
Ok &= loadResource(_currentLocale, resource);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue