|
|
@ -135,7 +135,7 @@ void readTranslationFile()
|
|
|
|
|
|
|
|
|
|
|
|
static tstring getTranslation( const tstring& fallback )
|
|
|
|
static tstring getTranslation( const tstring& fallback )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::map< std::wstring, std::wstring >::iterator i = s_translationMap.tqfind( fallback );
|
|
|
|
std::map< std::wstring, std::wstring >::iterator i = s_translationMap.find( fallback );
|
|
|
|
if (i!=s_translationMap.end())
|
|
|
|
if (i!=s_translationMap.end())
|
|
|
|
return i->second;
|
|
|
|
return i->second;
|
|
|
|
return fallback;
|
|
|
|
return fallback;
|
|
|
@ -153,14 +153,14 @@ static tstring getTranslation( const tstring& fallback )
|
|
|
|
static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT(""), const tstring& r3=TEXT("") )
|
|
|
|
static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT(""), const tstring& r3=TEXT("") )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tstring arg1 = TEXT("%1");
|
|
|
|
tstring arg1 = TEXT("%1");
|
|
|
|
size_t pos1 = s.tqfind( arg1 );
|
|
|
|
size_t pos1 = s.find( arg1 );
|
|
|
|
tstring arg2 = TEXT("%2");
|
|
|
|
tstring arg2 = TEXT("%2");
|
|
|
|
size_t pos2 = s.tqfind( arg2 );
|
|
|
|
size_t pos2 = s.find( arg2 );
|
|
|
|
tstring arg3 = TEXT("%3");
|
|
|
|
tstring arg3 = TEXT("%3");
|
|
|
|
size_t pos3 = s.tqfind( arg3 );
|
|
|
|
size_t pos3 = s.find( arg3 );
|
|
|
|
if ( pos1 != size_t(-1) )
|
|
|
|
if ( pos1 != size_t(-1) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
s.tqreplace( pos1, arg1.length(), r1 );
|
|
|
|
s.replace( pos1, arg1.length(), r1 );
|
|
|
|
if ( pos2 != size_t(-1) && pos1<pos2 )
|
|
|
|
if ( pos2 != size_t(-1) && pos1<pos2 )
|
|
|
|
pos2 += r1.length() - arg1.length();
|
|
|
|
pos2 += r1.length() - arg1.length();
|
|
|
|
if ( pos3 != size_t(-1) && pos1<pos3 )
|
|
|
|
if ( pos3 != size_t(-1) && pos1<pos3 )
|
|
|
@ -168,13 +168,13 @@ static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT("
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pos2 != size_t(-1) )
|
|
|
|
if ( pos2 != size_t(-1) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
s.tqreplace( pos2, arg2.length(), r2 );
|
|
|
|
s.replace( pos2, arg2.length(), r2 );
|
|
|
|
if ( pos3 != size_t(-1) && pos2<pos3 )
|
|
|
|
if ( pos3 != size_t(-1) && pos2<pos3 )
|
|
|
|
pos3 += r2.length() - arg2.length();
|
|
|
|
pos3 += r2.length() - arg2.length();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pos3 != size_t(-1) )
|
|
|
|
if ( pos3 != size_t(-1) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
s.tqreplace( pos3, arg3.length(), r3 );
|
|
|
|
s.replace( pos3, arg3.length(), r3 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|