解决 lupdate warning: no TS files specified.

简介: 解决 lupdate warning: no TS files specified.

环境:linux


情景:使用QT语言家的时候,在.pro文件中添加声明后,点击工具-外部-Qt Quick-更新后不生成.ts文件,编译提示如标题显示。


解决方法:命令行使用命令生成.ts文件,再用命令将.ts文件翻译为.qm文件


具体步骤:


1.项目中添加配置信息【很重要】


.pro文件中添加如下:(如果你的pro名字为hello.pro)


1)如果你只有一个翻译文件

TRANSLATIONS += zh_CN.ts  

2)如果你有两个以上翻译文件,用 \ 隔开

1. TRANSLATIONS += zh_CN.ts  \
2.         bo_CN.ts

2.生成.ts文件命令:

lupdate hello.pro

此时应该在项目中自动生成两个.ts文件

3.生成.qm文件命令:

1. lrelease zh_CN.ts -qm zh_CN.qm
2. lrelease bo_CN.ts -qm bo_CN.qm

此时项目中应该多生成两个.qm文件

相关文章
|
11月前
target\surefire-reports for the individual test results
target\surefire-reports for the individual test results
544 0
error: Your local changes to the following files would be overwritten by merge
error: Your local changes to the following files would be overwritten by merge
|
8月前
|
JavaScript
Error TS6138 - Property xxxx is declared but its value is never read
Error TS6138 - Property xxxx is declared but its value is never read
53 0
|
Unix Linux 异构计算
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See  /var/log/nv
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
87 0
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
成功解决Module Not Found Error : No module named mglearn
成功解决Module Not Found Error : No module named mglearn