mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Show the article in RTL mode if the target language is hebrew (patch by dmdmdm)
Some refinements done by ikm.
This commit is contained in:
parent
689859082c
commit
d431321f3d
|
@ -70,6 +70,13 @@ pre
|
||||||
* therefore hidden */
|
* therefore hidden */
|
||||||
.bglpos { display: none; }
|
.bglpos { display: none; }
|
||||||
|
|
||||||
|
/* Right-to-left text */
|
||||||
|
.bglrtl
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
/******** StarDict dictionaries' classes *********/
|
/******** StarDict dictionaries' classes *********/
|
||||||
|
|
||||||
|
|
||||||
|
|
15
src/bgl.cc
15
src/bgl.cc
|
@ -9,6 +9,7 @@
|
||||||
#include "utf8.hh"
|
#include "utf8.hh"
|
||||||
#include "chunkedstorage.hh"
|
#include "chunkedstorage.hh"
|
||||||
#include "langcoder.hh"
|
#include "langcoder.hh"
|
||||||
|
#include "language.hh"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -641,21 +642,29 @@ void BglArticleRequest::run()
|
||||||
"</b></b></b></b></b></b></b></b>"
|
"</b></b></b></b></b></b></b></b>"
|
||||||
"</i></i></i></i></i></i></i></i>";
|
"</i></i></i></i></i></i></i></i>";
|
||||||
|
|
||||||
|
static Language::Id hebrew = LangCoder::code2toInt( "he" );
|
||||||
|
|
||||||
for( i = mainArticles.begin(); i != mainArticles.end(); ++i )
|
for( i = mainArticles.begin(); i != mainArticles.end(); ++i )
|
||||||
{
|
{
|
||||||
result += "<h3>";
|
result += "<h3>";
|
||||||
result += postfixToSuperscript( i->second.first );
|
result += postfixToSuperscript( i->second.first );
|
||||||
result += "</h3>";
|
result += "</h3>";
|
||||||
result += i->second.second;
|
if ( dict.idxHeader.langTo == hebrew )
|
||||||
|
result += "<div class=\"bglrtl\">" + i->second.second + "</div>";
|
||||||
|
else
|
||||||
|
result += i->second.second ;
|
||||||
result += cleaner;
|
result += cleaner;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = alternateArticles.begin(); i != alternateArticles.end(); ++i )
|
for( i = alternateArticles.begin(); i != alternateArticles.end(); ++i )
|
||||||
{
|
{
|
||||||
result += "<h3>";
|
result += "<h3>";
|
||||||
result += postfixToSuperscript( i->second.first );
|
result += postfixToSuperscript( i->second.first );
|
||||||
result += "</h3>";
|
result += "</h3>";
|
||||||
result += i->second.second;
|
if ( dict.idxHeader.langTo == hebrew )
|
||||||
|
result += "<div class=\"bglrtl\">" + i->second.second + "</div>";
|
||||||
|
else
|
||||||
|
result += i->second.second ;
|
||||||
result += cleaner;
|
result += cleaner;
|
||||||
}
|
}
|
||||||
// Do some cleanups in the text
|
// Do some cleanups in the text
|
||||||
|
|
Loading…
Reference in a new issue