mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 16:04:06 +00:00
fix: properly load qt and webengine translations, delete GD's custom ones
This commit is contained in:
parent
70d21d7eca
commit
a61bcb1629
|
@ -1,3 +0,0 @@
|
||||||
qtwebengine_zh_CN.ts is used to fixed some right context menu on webengine.
|
|
||||||
|
|
||||||
The previous qt_* rename to qt_extra_* to distinguish between the locale language.These qt_extra*.ts are also used to fix GUI translation issues as qt has not provided an update version about these language.
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,467 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!DOCTYPE TS>
|
|
||||||
<TS version="2.1" language="zh_CN">
|
|
||||||
<context>
|
|
||||||
<name>DownloadInterruptReason</name>
|
|
||||||
<message>
|
|
||||||
<source>Unknown reason or not interrupted</source>
|
|
||||||
<translation>未知原因或非中断</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>General file operation failure</source>
|
|
||||||
<translation>文件操作失败</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The file cannot be written locally, due to access restrictions</source>
|
|
||||||
<translation>由于访问限制,该文件无法在本地写入</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Insufficient space on the target drive</source>
|
|
||||||
<translation>目标驱动器上的空间不足</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The directory or file name is too long</source>
|
|
||||||
<translation>目录或文件名太长</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The file size exceeds the file system limitation</source>
|
|
||||||
<translation>文件大小超过文件系统限制</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The file is infected with a virus</source>
|
|
||||||
<translation>该文件感染了病毒</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Temporary problem (for example file in use, or too many open files)</source>
|
|
||||||
<translation>临时问题(例如文件正在使用或打开的文件太多)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The file was blocked due to local policy</source>
|
|
||||||
<translation>由于本地政策,该文件被阻止</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Checking the safety of the download failed due to unexpected reasons</source>
|
|
||||||
<translation>由于意外原因,检查下载的安全性失败</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>File seek past the end of a file (resuming previously interrupted download)</source>
|
|
||||||
<translation>文件搜索超过文件末尾(恢复先前中断的下载)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The partial file did not match the expected hash</source>
|
|
||||||
<translation>部分文件与预期的哈希不匹配</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>General network failure</source>
|
|
||||||
<translation>一般网络故障</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The network operation has timed out</source>
|
|
||||||
<translation>网络操作超时</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The network connection has been terminated</source>
|
|
||||||
<translation>网络连接已终止</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The server has gone down</source>
|
|
||||||
<translation>服务器宕机了</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The network request was invalid (for example, the URL or scheme is invalid)</source>
|
|
||||||
<translation>网络请求无效(例如,URL或scheme无效)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>General server failure</source>
|
|
||||||
<translation>一般服务器故障</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The server does not have the requested data</source>
|
|
||||||
<translation>服务器没有请求的数据</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The server did not authorize access to the resource</source>
|
|
||||||
<translation>服务器未授权访问资源</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>A problem with the server certificate occurred</source>
|
|
||||||
<translation>服务器证书出现问题</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Access forbidden by the server</source>
|
|
||||||
<translation>服务器禁止访问</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Unexpected server response</source>
|
|
||||||
<translation>意外的服务器响应</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Download canceled by the user</source>
|
|
||||||
<translation>下载被用户取消</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>QQuickPdfDocument</name>
|
|
||||||
<message>
|
|
||||||
<source>no error</source>
|
|
||||||
<translation>无错误</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>data not yet available</source>
|
|
||||||
<translation>数据不可用</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>file not found</source>
|
|
||||||
<translation>文件未找到</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>invalid file format</source>
|
|
||||||
<translation>无效文件格式</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>incorrect password</source>
|
|
||||||
<translation>密码错误</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>unsupported security scheme</source>
|
|
||||||
<translation>不支持的安全方案</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>unknown error</source>
|
|
||||||
<translation>未知错误</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>QQuickWebEngineView</name>
|
|
||||||
<message>
|
|
||||||
<source>Stop</source>
|
|
||||||
<translation>停止</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Reload and Bypass Cache</source>
|
|
||||||
<translation>重新加载和绕过缓存</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Open link in this window</source>
|
|
||||||
<translation>在当前窗口中打开链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Toggle Play/Pause</source>
|
|
||||||
<translation>播放/暂停</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Toggle Mute</source>
|
|
||||||
<translation>静音</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Close Page</source>
|
|
||||||
<translation>关闭页面</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Unselect</source>
|
|
||||||
<translation>取消选择</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Bold</source>
|
|
||||||
<translation>加粗(&B)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Italic</source>
|
|
||||||
<translation>斜体(&I)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Underline</source>
|
|
||||||
<translation>下划线(&U)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Strikethrough</source>
|
|
||||||
<translation>删除线(&S)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Left</source>
|
|
||||||
<translation>左对齐(&L)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Center</source>
|
|
||||||
<translation>居中(&C)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Right</source>
|
|
||||||
<translation>右对齐(&R)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Justified</source>
|
|
||||||
<translation>对齐(&J)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Indent</source>
|
|
||||||
<translation>缩进(&I)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Outdent</source>
|
|
||||||
<translation>突出(&O)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Insert &Ordered List</source>
|
|
||||||
<translation>插入有序列表(&O)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Insert &Unordered List</source>
|
|
||||||
<translation>插入无序列表(&U)</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>QWebEnginePage</name>
|
|
||||||
<message>
|
|
||||||
<source>Stop</source>
|
|
||||||
<translation>停止</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Reload and Bypass Cache</source>
|
|
||||||
<translation>重新加载和绕过缓存</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Toggle Play/Pause</source>
|
|
||||||
<translation>播放/暂停</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Toggle Mute</source>
|
|
||||||
<translation>静音</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Close Page</source>
|
|
||||||
<translation>关闭页面</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Unselect</source>
|
|
||||||
<translation>取消选择</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Are you sure you want to leave this page? Changes that you made may not be saved.</source>
|
|
||||||
<translation>您确定要离开此页面吗? 您所做的更改不会被保存。</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Open link in this window</source>
|
|
||||||
<translation>在当前窗口中打开链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Open link in new background tab</source>
|
|
||||||
<translation>在新的后台选项卡中打开链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Bold</source>
|
|
||||||
<translation>加粗(&B)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Italic</source>
|
|
||||||
<translation>斜体(&I)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Underline</source>
|
|
||||||
<translation>下划线(&U)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Strikethrough</source>
|
|
||||||
<translation>删除线(&S)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Left</source>
|
|
||||||
<translation>左对齐(&L)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Center</source>
|
|
||||||
<translation>居中(&C)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Right</source>
|
|
||||||
<translation>右对齐(&R)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Align &Justified</source>
|
|
||||||
<translation>对齐(&J)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Indent</source>
|
|
||||||
<translation>缩进(&I)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Outdent</source>
|
|
||||||
<translation>突出(&O)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Insert &Ordered List</source>
|
|
||||||
<translation>插入有序列表(&O)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Insert &Unordered List</source>
|
|
||||||
<translation>插入无序列表(&U)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Select folder to upload</source>
|
|
||||||
<translation>选择要上传的文件夹</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>QtWebEnginePlugin</name>
|
|
||||||
<message>
|
|
||||||
<source>Cannot create separate instance of WebEngineNewViewRequest</source>
|
|
||||||
<translation>无法创建 WebEngineNewViewRequest 的单独实例</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Cannot create separate instance of %1</source>
|
|
||||||
<translation>无法创建 %1 的单独实例</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>QtWebEngineTestSupportPlugin</name>
|
|
||||||
<message>
|
|
||||||
<source>Cannot create a separate instance of WebEngineErrorPage</source>
|
|
||||||
<translation>无法创建 WebEngineErrorPage 的单独实例</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Cannot create a separate instance of WebEngineTestEvent</source>
|
|
||||||
<translation>无法创建单独的 WebEngineTestEvent 实例</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>RenderViewContextMenuQt</name>
|
|
||||||
<message>
|
|
||||||
<source>Back</source>
|
|
||||||
<translation>后退</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Forward</source>
|
|
||||||
<translation>前进</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Reload</source>
|
|
||||||
<translation>重载</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Cut</source>
|
|
||||||
<translation>剪切</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Copy</source>
|
|
||||||
<translation>复制</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Paste</source>
|
|
||||||
<translation>粘贴</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Undo</source>
|
|
||||||
<translation>撤销</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Redo</source>
|
|
||||||
<translation>恢复</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Select all</source>
|
|
||||||
<translation>全选</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Paste and match style</source>
|
|
||||||
<translation>粘贴并匹配样式</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Open link in new window</source>
|
|
||||||
<translation>在新窗口中打开链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Open link in new tab</source>
|
|
||||||
<translation>在新页签中打开链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Copy link address</source>
|
|
||||||
<translation>复制链接地址</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Save link</source>
|
|
||||||
<translation>保存链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Copy image</source>
|
|
||||||
<translation>复制图片</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Copy image address</source>
|
|
||||||
<translation>复制图片地址</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Save image</source>
|
|
||||||
<translation>保存图片</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Copy media address</source>
|
|
||||||
<translation>复制媒体链接</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Show controls</source>
|
|
||||||
<translation>显示控制</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Loop</source>
|
|
||||||
<translation>循环</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Save media</source>
|
|
||||||
<translation>保存媒体</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Inspect</source>
|
|
||||||
<translation>审核</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Exit full screen</source>
|
|
||||||
<translation>退出全屏</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Save page</source>
|
|
||||||
<translation>保存页面</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>View page source</source>
|
|
||||||
<translation>查看页面源代码</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>UIDelegatesManager</name>
|
|
||||||
<message>
|
|
||||||
<source>Javascript Alert - %1</source>
|
|
||||||
<translation>Javascript-警告 - %1</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Javascript Confirm - %1</source>
|
|
||||||
<translation>Javascript-确认 - %1</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Javascript Prompt - %1</source>
|
|
||||||
<translation>Javascript-提醒 - %1</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Are you sure you want to leave this page?</source>
|
|
||||||
<translation>您确定要离开当前页面吗?</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Changes that you made may not be saved.</source>
|
|
||||||
<translation>您所做的更改不会被保存。</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Connect to proxy "%1" using:</source>
|
|
||||||
<translation>使用以下命令连接到代理“%1”:</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Enter username and password for "%1" at %2://%3</source>
|
|
||||||
<translation>在 %2://%3 输入“%1”的用户名和密码</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>WebContentsAdapter</name>
|
|
||||||
<message>
|
|
||||||
<source>HTTP-POST data can only be sent over HTTP(S) protocol</source>
|
|
||||||
<translation>HTTP-POST 数据只能通过 HTTP(S) 协议发送</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
</TS>
|
|
29
src/main.cc
29
src/main.cc
|
@ -564,18 +564,35 @@ int main( int argc, char ** argv )
|
||||||
QLocale::setDefault( locale );
|
QLocale::setDefault( locale );
|
||||||
QApplication::setLayoutDirection( locale.textDirection() );
|
QApplication::setLayoutDirection( locale.textDirection() );
|
||||||
|
|
||||||
if ( !qtTranslator.load( "qt_extra_" + localeName, Config::getLocDir() ) ) {
|
// Load Qt translators
|
||||||
qtTranslator.load( "qt_extra_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) );
|
// For Windows, windeployqt will combine multiple qt modules translations into `qt_*`
|
||||||
|
// Thus, after deployment, loading `qtwebengine_*` is guaranteed to fail on Windows.
|
||||||
|
if ( qtTranslator.load( locale, "qt", "_", QLibraryInfo::path( QLibraryInfo::TranslationsPath ) ) ) {
|
||||||
app.installTranslator( &qtTranslator );
|
app.installTranslator( &qtTranslator );
|
||||||
|
qDebug() << "qt translator loaded: " << qtTranslator.filePath();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << "qt translator didn't load anything.";
|
||||||
}
|
}
|
||||||
|
|
||||||
translator.load( Config::getLocDir() + "/" + localeName );
|
|
||||||
app.installTranslator( &translator );
|
|
||||||
|
|
||||||
QTranslator webengineTs;
|
QTranslator webengineTs;
|
||||||
if ( webengineTs.load( "qtwebengine_" + localeName, Config::getLocDir() ) ) {
|
if ( webengineTs.load( locale, "qtwebengine", "_", QLibraryInfo::path( QLibraryInfo::TranslationsPath ) ) ) {
|
||||||
app.installTranslator( &webengineTs );
|
app.installTranslator( &webengineTs );
|
||||||
|
qDebug() << "qt webengine translator loaded: " << webengineTs.filePath();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << "qt webengine translator may or may not be loaded.";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load GD's translations, note GD has local names beyond what's supported by QLocal
|
||||||
|
if ( translator.load( localeName, Config::getLocDir() ) ) {
|
||||||
|
app.installTranslator( &translator );
|
||||||
|
qDebug() << "gd translator loaded: " << translator.filePath();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << "gd translator didn't load anything";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Prevent app from quitting spontaneously when it works with popup
|
// Prevent app from quitting spontaneously when it works with popup
|
||||||
// and with the main window closed.
|
// and with the main window closed.
|
||||||
|
|
Loading…
Reference in a new issue