under class
BglArticleRequest
I added a method:
- Code: Select all
void fixHebString(string & hebStr);
and implemented
- Code: Select all
void BglArticleRequest::fixHebString(string & hebStr)
{
wstring hebWStr=Utf8::decode(hebStr);
for (unsigned int i=0; i<hebWStr.size();i++)
{
if (hebWStr[i]>=224 && hebWStr[i]<=250)
hebWStr[i]+=1488-224;
}
hebStr=Utf8::encode(hebWStr);
}
under the method:
- Code: Select all
void BglArticleRequest::run()
I moved the line:
- Code: Select all
static Language::Id hebrew = LangCoder::code2toInt( "he" );
to the begining of the method (before the next loop) and in this loop:
- Code: Select all
for( unsigned x = 0; x < chain.size(); ++x )
after the line:
- Code: Select all
wstring headwordStripped =
Folding::applySimpleCaseOnly( Utf8::decode( removePostfix( headword ) ) );
I added:
- Code: Select all
displayedHeadword= displayedHeadword.size() ? displayedHeadword : headword;
if (dict.idxHeader.langFrom == hebrew)
{
fixHebString(articleText);
fixHebString(displayedHeadword);
}
and few lines after, I changed the insertation into:
- Code: Select all
mapToUse.insert( pair< wstring, pair< string, string > >(
Folding::applySimpleCaseOnly( Utf8::decode( headword ) ),
pair< string, string >( displayedHeadword,
articleText ) ) );
in the same method I changed the code in the loops of "mainArticles" and "alternateArticles". instead of
- Code: Select all
result += "<h3>";
result += postfixToSuperscript( i->second.first );
result += "</h3>";
I did:
- Code: Select all
if (dict.idxHeader.langFrom == hebrew)
result += "<h3 style=\"text-align:right;direction:rtl\">";
else
result += "<h3>";
result += postfixToSuperscript( i->second.first );
result += "</h3>";
in both of the loops... and this should fix most of the problems in hebrew
note that the rtl fix should be applied to all rtl languages, and not only hebrew