1. 程式人生 > 其它 >Qt中lupdate 和 lrealease 命令使用

Qt中lupdate 和 lrealease 命令使用

技術標籤:Qt

Qt中lupdate 和 lrealease 命令使用

lupdate 的命令列引數說明

Usage:
lupdate [options] [project-file]
lupdate [options] [source-file|path|@lst-file] -ts ts-files|@lst-file

Options:
-no-obsolete
刪除所有無用的字串。
-extensions [,]
處理具有給定副檔名的檔案。擴充套件列表必須用逗號隔開。
預設: ‘java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml’

-no-recursive
      不要遞迴掃描以下目錄
-recursive
       遞迴掃描以下目錄(預設)
-I <includepath> or -I<includepath>   (注意著是i的大寫)
       查詢包含檔案的其他位置,可以多次使用包含多個路徑
-pro <filename>
       新增工程檔案,遞迴新增檔案
-source-language <language>[_<region>]
      指定被翻譯檔案字符集。預設 POSIX 
-target-language <language>
[_<region>] 指定翻譯檔案字符集 -ts <ts-file> 指定輸出翻譯檔案

例如:lupdate -no-recursive ./src –ts translate.ts

lrealease的命令列引數說明

Usage:
lrelease [options] project-file
lrelease [options] ts-files [-qm qm-file]

Options:

-idbased
	使用ID而不是源字串進行訊息鍵控
-compress
	壓縮QM檔案
-nounfinished
	不包括未完成的翻譯
-removeidentical
	譯文和原文相同不包含
-
markuntranslated <prefix> 如果翻譯沒有完全翻完,使用這個為字首加上後續 -qm <qm-file> 指定輸出QM檔案

例如:lrelease translate.ts –qm translate.qm