解决翻译问题。
This commit is contained in:
parent
6d060e2c0b
commit
6009d862ca
|
@ -25,26 +25,26 @@ UkuiSearchGui::UkuiSearchGui(int &argc, char *argv[], const QString &application
|
||||||
|
|
||||||
|
|
||||||
//load translations.
|
//load translations.
|
||||||
QTranslator translator;
|
QTranslator *translator = new QTranslator(this);
|
||||||
try {
|
try {
|
||||||
if(! translator.load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1;
|
if(! translator->load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1;
|
||||||
this->installTranslator(&translator);
|
this->installTranslator(translator);
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
qDebug() << "Load translations file" << QLocale() << "failed!";
|
qDebug() << "Load translations file" << QLocale() << "failed!";
|
||||||
}
|
}
|
||||||
|
|
||||||
QTranslator qt_translator;
|
QTranslator *qt_translator = new QTranslator(this);
|
||||||
try {
|
try {
|
||||||
if(! qt_translator.load(":/res/qt-translations/qt_zh_CN.qm")) throw - 1;
|
if(! qt_translator->load(":/res/qt-translations/qt_zh_CN.qm")) throw - 1;
|
||||||
this->installTranslator(&qt_translator);
|
this->installTranslator(qt_translator);
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
qDebug() << "Load translations file" << QLocale() << "failed!";
|
qDebug() << "Load translations file" << QLocale() << "failed!";
|
||||||
}
|
}
|
||||||
|
|
||||||
QTranslator lib_translator;
|
QTranslator *lib_translator = new QTranslator(this);
|
||||||
try {
|
try {
|
||||||
if(! lib_translator.load("/usr/share/ukui-search/translations/libukui-search_" + QLocale::system().name())) throw - 1;
|
if(! lib_translator->load("/usr/share/ukui-search/translations/libukui-search_" + QLocale::system().name())) throw - 1;
|
||||||
this->installTranslator(&lib_translator);
|
this->installTranslator(lib_translator);
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
qDebug() << "Load translations file" << QLocale() << "failed!";
|
qDebug() << "Load translations file" << QLocale() << "failed!";
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,7 +302,7 @@ QWidget *DirSearchPlugin::detailPage(const ResultInfo &ri)
|
||||||
} else {
|
} else {
|
||||||
m_nameLabel->setToolTip("");
|
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->setText(m_pathLabel2->fontMetrics().elidedText(m_currentActionKey, Qt::ElideRight, m_pathLabel2->width()));
|
||||||
m_pathLabel2->setToolTip(m_currentActionKey);
|
m_pathLabel2->setToolTip(m_currentActionKey);
|
||||||
|
|
|
@ -5,123 +5,123 @@
|
||||||
<name>Search</name>
|
<name>Search</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="13"/>
|
<location filename="../search.cpp" line="13"/>
|
||||||
<location filename="../search.cpp" line="130"/>
|
<location filename="../search.cpp" line="121"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation>搜索</translation>
|
<translation>搜索</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="154"/>
|
<location filename="../search.cpp" line="145"/>
|
||||||
<source>Create index</source>
|
<source>Create index</source>
|
||||||
<translation>创建索引</translation>
|
<translation>创建索引</translation>
|
||||||
<extra-contents_path>/Search/Create index</extra-contents_path>
|
<extra-contents_path>/Search/Create index</extra-contents_path>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="155"/>
|
<location filename="../search.cpp" line="146"/>
|
||||||
<source>Creating index can help you getting results quickly.</source>
|
<source>Creating index can help you getting results quickly.</source>
|
||||||
<translation>开启之后可以快速获取搜索结果</translation>
|
<translation>开启之后可以快速获取搜索结果</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="174"/>
|
<location filename="../search.cpp" line="165"/>
|
||||||
<source>Default web searching engine</source>
|
<source>Default web searching engine</source>
|
||||||
<translation>默认互联网搜索引擎</translation>
|
<translation>默认互联网搜索引擎</translation>
|
||||||
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
|
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="178"/>
|
<location filename="../search.cpp" line="169"/>
|
||||||
<source>baidu</source>
|
<source>baidu</source>
|
||||||
<translation>百度</translation>
|
<translation>百度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="179"/>
|
<location filename="../search.cpp" line="170"/>
|
||||||
<source>sougou</source>
|
<source>sougou</source>
|
||||||
<translation>搜狗</translation>
|
<translation>搜狗</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="180"/>
|
<location filename="../search.cpp" line="171"/>
|
||||||
<source>360</source>
|
<source>360</source>
|
||||||
<translation>360</translation>
|
<translation>360</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="188"/>
|
<location filename="../search.cpp" line="179"/>
|
||||||
<source>Block Folders</source>
|
<source>Block Folders</source>
|
||||||
<translation>排除的文件夹</translation>
|
<translation>排除的文件夹</translation>
|
||||||
<extra-contents_path>/Search/Block Folders</extra-contents_path>
|
<extra-contents_path>/Search/Block Folders</extra-contents_path>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
|
||||||
<translation>搜索将不查看以下文件夹,通过添加和删除可以设置排除的文件夹位置</translation>
|
<translation>搜索将不查看以下文件夹,通过添加和删除可以设置排除的文件夹位置</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="233"/>
|
<location filename="../search.cpp" line="224"/>
|
||||||
<source>Choose folder</source>
|
<source>Choose folder</source>
|
||||||
<translation>添加</translation>
|
<translation>添加</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="346"/>
|
<location filename="../search.cpp" line="337"/>
|
||||||
<source>delete</source>
|
<source>delete</source>
|
||||||
<translation>删除</translation>
|
<translation>删除</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="401"/>
|
<location filename="../search.cpp" line="392"/>
|
||||||
<source>Directories</source>
|
<source>Directories</source>
|
||||||
<translation>文件夹</translation>
|
<translation>文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="402"/>
|
<location filename="../search.cpp" line="393"/>
|
||||||
<source>select blocked folder</source>
|
<source>select blocked folder</source>
|
||||||
<translation>选择排除的文件夹</translation>
|
<translation>选择排除的文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="403"/>
|
<location filename="../search.cpp" line="394"/>
|
||||||
<source>Select</source>
|
<source>Select</source>
|
||||||
<translation>选择</translation>
|
<translation>选择</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="404"/>
|
<location filename="../search.cpp" line="395"/>
|
||||||
<source>Position: </source>
|
<source>Position: </source>
|
||||||
<translation>位置</translation>
|
<translation>位置</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="405"/>
|
<location filename="../search.cpp" line="396"/>
|
||||||
<source>FileName: </source>
|
<source>FileName: </source>
|
||||||
<translation>文件名</translation>
|
<translation>文件名</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="406"/>
|
<location filename="../search.cpp" line="397"/>
|
||||||
<source>FileType: </source>
|
<source>FileType: </source>
|
||||||
<translation>类型</translation>
|
<translation>类型</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="407"/>
|
<location filename="../search.cpp" line="398"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation>取消</translation>
|
<translation>取消</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="423"/>
|
<location filename="../search.cpp" line="414"/>
|
||||||
<location filename="../search.cpp" line="427"/>
|
<location filename="../search.cpp" line="418"/>
|
||||||
<location filename="../search.cpp" line="431"/>
|
<location filename="../search.cpp" line="422"/>
|
||||||
<location filename="../search.cpp" line="435"/>
|
<location filename="../search.cpp" line="426"/>
|
||||||
<source>Warning</source>
|
<source>Warning</source>
|
||||||
<translation>警告</translation>
|
<translation>警告</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../search.cpp" line="423"/>
|
<location filename="../search.cpp" line="414"/>
|
||||||
<source>Add blocked folder failed, choosen path is empty!</source>
|
<source>Add blocked folder failed, choosen path is empty!</source>
|
||||||
<translation>添加失败,选择的路径为空!</translation>
|
<translation>添加失败,选择的路径为空!</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>Add blocked folder failed, it is not in home path!</source>
|
||||||
<translation>添加失败,添加的路径不在家目录下!</translation>
|
<translation>添加失败,添加的路径不在家目录下!</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>Add blocked folder failed, its parent dir is exist!</source>
|
||||||
<translation>添加失败,父目录已被添加!</translation>
|
<translation>添加失败,父目录已被添加!</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>Add blocked folder failed, it has been already blocked!</source>
|
||||||
<translation>添加失败,这个文件夹已经被添加过了!</translation>
|
<translation>添加失败,这个文件夹已经被添加过了!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -82,15 +82,19 @@
|
||||||
<source>Dir Search</source>
|
<source>Dir Search</source>
|
||||||
<translation>目录搜索</translation>
|
<translation>目录搜索</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../libsearch/index/file-search-plugin.cpp" line="302"/>
|
||||||
|
<source>Directory</source>
|
||||||
|
<translation>目录</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/index/file-search-plugin.cpp" line="237"/>
|
<location filename="../../libsearch/index/file-search-plugin.cpp" line="237"/>
|
||||||
<source>Dir search.</source>
|
<source>Dir search.</source>
|
||||||
<translation>目录搜索。</translation>
|
<translation>目录搜索。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/index/file-search-plugin.cpp" line="302"/>
|
|
||||||
<source>directory</source>
|
<source>directory</source>
|
||||||
<translation>目录</translation>
|
<translation type="vanished">目录</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/index/file-search-plugin.cpp" line="339"/>
|
<location filename="../../libsearch/index/file-search-plugin.cpp" line="339"/>
|
||||||
|
@ -313,12 +317,12 @@
|
||||||
<context>
|
<context>
|
||||||
<name>UkuiSearch::SearchManager</name>
|
<name>UkuiSearch::SearchManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/index/search-manager.cpp" line="67"/>
|
<location filename="../../libsearch/index/search-manager.cpp" line="68"/>
|
||||||
<source>Path:</source>
|
<source>Path:</source>
|
||||||
<translation>路径:</translation>
|
<translation>路径:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/index/search-manager.cpp" line="68"/>
|
<location filename="../../libsearch/index/search-manager.cpp" line="69"/>
|
||||||
<source>Modified time:</source>
|
<source>Modified time:</source>
|
||||||
<translation>修改时间:</translation>
|
<translation>修改时间:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../frontend/mainwindow.cpp" line="75"/>
|
<location filename="../../frontend/mainwindow.cpp" line="76"/>
|
||||||
<source>Global Search</source>
|
<source>Global Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -358,7 +358,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../frontend/mainwindow.cpp" line="75"/>
|
<location filename="../../frontend/mainwindow.cpp" line="76"/>
|
||||||
<source>Global Search</source>
|
<source>Global Search</source>
|
||||||
<translation type="unfinished">Genel Arama</translation>
|
<translation type="unfinished">Genel Arama</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
<translation>搜索</translation>
|
<translation>搜索</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../frontend/mainwindow.cpp" line="75"/>
|
<location filename="../../frontend/mainwindow.cpp" line="76"/>
|
||||||
<source>Global Search</source>
|
<source>Global Search</source>
|
||||||
<translation>搜索</translation>
|
<translation>搜索</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in New Issue