feat(i18n): 英文翻译(95 条)并验证加载
- translations/gxde-ai-see_en.ts 全部翻译完成 - selftest 支持 GXDE_AI_SEE_QM 环境变量,验证 3 个上下文的翻译生效 - CHANGELOG 更新
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QTextStream>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "actions/texttools.h"
|
||||
#include "factory/contentclassifier.h"
|
||||
@@ -39,6 +40,22 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
if (qEnvironmentVariableIsSet("GXDE_AI_SEE_QM")) {
|
||||
auto *translator = new QTranslator(&app);
|
||||
if (translator->load(QString::fromLocal8Bit(qgetenv("GXDE_AI_SEE_QM")))) {
|
||||
app.installTranslator(translator);
|
||||
check(QCoreApplication::translate("PortalPanel", "暂存区")
|
||||
== QStringLiteral("Staging"),
|
||||
"english translation: PortalPanel/暂存区");
|
||||
check(QCoreApplication::translate("ChatWindow", "发送") == QStringLiteral("Send"),
|
||||
"english translation: ChatWindow/发送");
|
||||
check(QCoreApplication::translate("TodoWindow", "待办") == QStringLiteral("Todo"),
|
||||
"english translation: TodoWindow/待办");
|
||||
} else {
|
||||
check(false, "load english .qm");
|
||||
}
|
||||
}
|
||||
|
||||
// http link with a video extension
|
||||
const LinkInfo video = LinkTools::parse(QStringLiteral("https://example.com/media/clip.mp4"));
|
||||
check(video.kind == LinkInfo::Http, "https link recognised");
|
||||
|
||||
Reference in New Issue
Block a user