// Suppose aKeyName is "a" // ini has " a [ en ] = Foo // a [ en_US ] = Bar " // and aFallbacks is { "en-US", "en" } // Then we must return "Bar", because its locale has higher fallback rank.
OStringBuffer aLineBuf; while (pStrm->ReadLine(aLineBuf))
{
std::string_view aLine(aLineBuf);
// comments if (aLine.starts_with("#")) continue;
size_t n = aLine.find('='); if (n == std::string_view::npos) continue;
// grisly language matching, is this not available somewhere else?
OUString aLang
= OStringToOUString(aLocale, RTL_TEXTENCODING_ASCII_US).replace('_', '-'); for (n = 0; n < nRank; ++n)
{ auto& rFallback = aFallbacks[n];
SAL_INFO( "svx", "compare '" << aLang << "' with '" << rFallback << "' rank " << nRank << " vs. " << n ); if (rFallback == aLang)
{
nRank = n; // try to get the most accurate match
aResult = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8);
}
} if (nRank == 0) break;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.