解决翻译问题。

This commit is contained in:
iaom 2022-05-23 15:48:16 +08:00
parent 6d060e2c0b
commit 6009d862ca
7 changed files with 47 additions and 43 deletions

View File

@ -25,26 +25,26 @@ UkuiSearchGui::UkuiSearchGui(int &argc, char *argv[], const QString &application
//load translations.
QTranslator translator;
QTranslator *translator = new QTranslator(this);
try {
if(! translator.load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1;
this->installTranslator(&translator);
if(! translator->load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1;
this->installTranslator(translator);
} catch(...) {
qDebug() << "Load translations file" << QLocale() << "failed!";
}
QTranslator qt_translator;
QTranslator *qt_translator = new QTranslator(this);
try {
if(! qt_translator.load(":/res/qt-translations/qt_zh_CN.qm")) throw - 1;
this->installTranslator(&qt_translator);
if(! qt_translator->load(":/res/qt-translations/qt_zh_CN.qm")) throw - 1;
this->installTranslator(qt_translator);
} catch(...) {
qDebug() << "Load translations file" << QLocale() << "failed!";
}
QTranslator lib_translator;
QTranslator *lib_translator = new QTranslator(this);
try {
if(! lib_translator.load("/usr/share/ukui-search/translations/libukui-search_" + QLocale::system().name())) throw - 1;
this->installTranslator(&lib_translator);
if(! lib_translator->load("/usr/share/ukui-search/translations/libukui-search_" + QLocale::system().name())) throw - 1;
this->installTranslator(lib_translator);
} catch(...) {
qDebug() << "Load translations file" << QLocale() << "failed!";
}

View File

@ -302,7 +302,7 @@ QWidget *DirSearchPlugin::detailPage(const ResultInfo &ri)
} else {
m_nameLabel->setToolTip("");
}
m_pluginLabel->setText(tr("directory"));
m_pluginLabel->setText(tr("Directory"));
m_pathLabel2->setText(m_pathLabel2->fontMetrics().elidedText(m_currentActionKey, Qt::ElideRight, m_pathLabel2->width()));
m_pathLabel2->setToolTip(m_currentActionKey);

View File

@ -5,123 +5,123 @@
<name>Search</name>
<message>
<location filename="../search.cpp" line="13"/>
<location filename="../search.cpp" line="130"/>
<location filename="../search.cpp" line="121"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="154"/>
<location filename="../search.cpp" line="145"/>
<source>Create index</source>
<translation></translation>
<extra-contents_path>/Search/Create index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="155"/>
<location filename="../search.cpp" line="146"/>
<source>Creating index can help you getting results quickly.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="174"/>
<location filename="../search.cpp" line="165"/>
<source>Default web searching engine</source>
<translation></translation>
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="178"/>
<location filename="../search.cpp" line="169"/>
<source>baidu</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="179"/>
<location filename="../search.cpp" line="170"/>
<source>sougou</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="180"/>
<location filename="../search.cpp" line="171"/>
<source>360</source>
<translation>360</translation>
</message>
<message>
<location filename="../search.cpp" line="188"/>
<location filename="../search.cpp" line="179"/>
<source>Block Folders</source>
<translation></translation>
<extra-contents_path>/Search/Block Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="193"/>
<location filename="../search.cpp" line="184"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="233"/>
<location filename="../search.cpp" line="224"/>
<source>Choose folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="346"/>
<location filename="../search.cpp" line="337"/>
<source>delete</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="401"/>
<location filename="../search.cpp" line="392"/>
<source>Directories</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="402"/>
<location filename="../search.cpp" line="393"/>
<source>select blocked folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="403"/>
<location filename="../search.cpp" line="394"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="404"/>
<location filename="../search.cpp" line="395"/>
<source>Position: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="405"/>
<location filename="../search.cpp" line="396"/>
<source>FileName: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="406"/>
<location filename="../search.cpp" line="397"/>
<source>FileType: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="407"/>
<location filename="../search.cpp" line="398"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="423"/>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="435"/>
<location filename="../search.cpp" line="414"/>
<location filename="../search.cpp" line="418"/>
<location filename="../search.cpp" line="422"/>
<location filename="../search.cpp" line="426"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="423"/>
<location filename="../search.cpp" line="414"/>
<source>Add blocked folder failed, choosen path is empty!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="418"/>
<source>Add blocked folder failed, it is not in home path!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="422"/>
<source>Add blocked folder failed, its parent dir is exist!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="435"/>
<location filename="../search.cpp" line="426"/>
<source>Add blocked folder failed, it has been already blocked!</source>
<translation></translation>
</message>

View File

@ -82,15 +82,19 @@
<source>Dir Search</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/index/file-search-plugin.cpp" line="302"/>
<source>Directory</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/index/file-search-plugin.cpp" line="237"/>
<source>Dir search.</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/index/file-search-plugin.cpp" line="302"/>
<source>directory</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../libsearch/index/file-search-plugin.cpp" line="339"/>
@ -313,12 +317,12 @@
<context>
<name>UkuiSearch::SearchManager</name>
<message>
<location filename="../../libsearch/index/search-manager.cpp" line="67"/>
<location filename="../../libsearch/index/search-manager.cpp" line="68"/>
<source>Path:</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/index/search-manager.cpp" line="68"/>
<location filename="../../libsearch/index/search-manager.cpp" line="69"/>
<source>Modified time:</source>
<translation></translation>
</message>

View File

@ -58,7 +58,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../frontend/mainwindow.cpp" line="75"/>
<location filename="../../frontend/mainwindow.cpp" line="76"/>
<source>Global Search</source>
<translation type="unfinished"></translation>
</message>

View File

@ -358,7 +358,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../frontend/mainwindow.cpp" line="75"/>
<location filename="../../frontend/mainwindow.cpp" line="76"/>
<source>Global Search</source>
<translation type="unfinished">Genel Arama</translation>
</message>

View File

@ -120,7 +120,7 @@
<translation></translation>
</message>
<message>
<location filename="../../frontend/mainwindow.cpp" line="75"/>
<location filename="../../frontend/mainwindow.cpp" line="76"/>
<source>Global Search</source>
<translation></translation>
</message>