epwing:translation does not work

This commit is contained in:
Xiao YiFang 2023-03-21 00:48:06 +08:00
parent 8cc5c54b78
commit fe6808d07a
2 changed files with 17 additions and 2 deletions

View file

@ -83,6 +83,8 @@ bool indexIsOldOrBad( string const & indexFile )
class EpwingDictionary: public BtreeIndexing::BtreeDictionary class EpwingDictionary: public BtreeIndexing::BtreeDictionary
{ {
Q_DECLARE_TR_FUNCTIONS(Epwing::EpwingDictionary)
Mutex idxMutex; Mutex idxMutex;
File::Class idx; File::Class idx;
IdxHeader idxHeader; IdxHeader idxHeader;
@ -334,7 +336,7 @@ string Epwing::EpwingDictionary::epwing_previous_button(int& articlePage, int& a
{ {
QString previousButton = QString( "p%1At%2" ).arg( articlePage ).arg( articleOffset ); QString previousButton = QString( "p%1At%2" ).arg( articlePage ).arg( articleOffset );
string previousLink = "<p><a class=\"epwing_previous_page\" href=\"gdlookup://localhost/" string previousLink = "<p><a class=\"epwing_previous_page\" href=\"gdlookup://localhost/"
+ previousButton.toStdString() + "\">" + QObject::tr( "Previous Page" ).toStdString() + "</a></p>"; + previousButton.toStdString() + "\">" + tr( "Previous Page" ).toStdString() + "</a></p>";
return previousLink; return previousLink;
} }
@ -370,7 +372,7 @@ string Epwing::EpwingDictionary::epwing_next_button(int& articlePage, int& artic
{ {
QString refLink = QString( "r%1At%2" ).arg( articlePage ).arg( articleOffset ); QString refLink = QString( "r%1At%2" ).arg( articlePage ).arg( articleOffset );
string nextLink = "<p><a class=\"epwing_next_page\" href=\"gdlookup://localhost/" + refLink.toStdString() + "\">" string nextLink = "<p><a class=\"epwing_next_page\" href=\"gdlookup://localhost/" + refLink.toStdString() + "\">"
+ QObject::tr( "Next Page" ).toStdString() + "</a></p>"; + tr( "Next Page" ).toStdString() + "</a></p>";
return nextLink; return nextLink;
} }

View file

@ -970,6 +970,19 @@ between classic and school orthography in cyrillic)</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>Epwing::EpwingDictionary</name>
<message>
<location filename="../epwing.cc" line="339"/>
<source>Previous Page</source>
<translation></translation>
</message>
<message>
<location filename="../epwing.cc" line="375"/>
<source>Next Page</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>ExternalViewer</name> <name>ExternalViewer</name>
<message> <message>