zoukankan      html  css  js  c++  java
  • 当qml文件添加到qrc文件中,实现internationalization(国际化)

    lupdate test.pro只检测 SOURCE 和 HEADER中的文件,当qml文件添加到qrc中时lupdate test.pro时不能被检测到,这时需要手动添加qml文件或者ts文件告诉lupdate时检测,

    具体步骤,example:

    test.pro文件

    TRANSLATIONS += 
      fr.ts
      ch.ts // 这里是需要生成的翻译的语言生成的ts文件

    lupdate_only{
      SOURCES +=
        test.qml
        common/*.qml
    }

    然后lupdate test.pro就OK了

    Usage:
         lupdate [options] [project-file]
         lupdate [options] [source-file|path]... -ts ts-files
     Options:
         -help  Display this information and exit.
         -noobsolete
                Drop all obsolete strings.
         -extensions <ext>[,<ext>]...
                Process files with the given extensions only.
                The extension list must be separated with commas, not with whitespace.
                Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
         -pluralonly
                Only include plural form messages.
         -silent
                Don't explain what is being done.
         -version
                Display the version of lupdate and exit.

    lrelease test.pro生成qm文件
     Usage:
         lrelease [options] project-file
         lrelease [options] ts-files [-qm qm-file]
     Options:
         -help  Display this information and exit
         -compress
                Compress the .qm files
         -nounfinished
                Do not include unfinished translations
         -removeidentical
                If the translated text is the same as
                the source text, do not include the message
         -silent
                Don't explain what is being done
         -version
                Display the version of lrelease and exit
  • 相关阅读:
    c中NULL,'\0'和0之间的区别. (the difference between NULL,'\0' and 0 in c)
    python 解析xml文件python parse xml.
    mysql升级 ,MySQL Error: #1558 Column count of mysql.proc is wrong. Expected 20, found 16.
    文献随笔15
    文献笔记11
    文献笔记16
    文献笔记13
    文献笔记17
    文献笔记20
    文献笔记19
  • 原文地址:https://www.cnblogs.com/fuyanwen/p/3907103.html
Copyright © 2011-2022 走看看