地面站终端 App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PX4 Build Bot 116597ad4f
New translations qgc-json.ts (Chinese Simplified)
11 months ago
..
README.md Switch to new translations directory (#9105) 4 years ago
qgc-json.ts Loc .ts file update 3 years ago
qgc-lupdate-json.py Fix translation scripts 4 years ago
qgc-lupdate.sh Loc .ts file update 3 years ago
qgc.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_az_AZ.ts New translations qgc-json.ts (Azerbaijani) 5 years ago
qgc_fa_IR.ts New Crowdin updates (#10902) 11 months ago
qgc_json_az_AZ.ts New Crowdin updates (#9961) 3 years ago
qgc_json_bg_BG.ts New Crowdin updates (#9961) 3 years ago
qgc_json_de_DE.ts New Crowdin updates (#9961) 3 years ago
qgc_json_el_GR.ts New Crowdin updates (#9961) 3 years ago
qgc_json_es_ES.ts New translations qgc-json.ts (Spanish) (#10030) 3 years ago
qgc_json_fi_FI.ts New Crowdin updates (#9961) 3 years ago
qgc_json_fr_FR.ts New translations qgc-json.ts (French) 3 years ago
qgc_json_he_IL.ts New Crowdin updates (#9961) 3 years ago
qgc_json_it_IT.ts New Crowdin updates (#9961) 3 years ago
qgc_json_ja_JP.ts New Crowdin updates (#10013) 3 years ago
qgc_json_ko_KR.ts New translations qgc-json.ts (Korean) 11 months ago
qgc_json_nl_NL.ts New Crowdin updates (#9961) 3 years ago
qgc_json_no_NO.ts New Crowdin updates (#9961) 3 years ago
qgc_json_pl_PL.ts New Crowdin updates (#9961) 3 years ago
qgc_json_pt_PT.ts New Crowdin updates (#9987) 3 years ago
qgc_json_ru_RU.ts New Crowdin updates (#9961) 3 years ago
qgc_json_sv_SE.ts New Crowdin updates (#9961) 3 years ago
qgc_json_tr_TR.ts New translations qgc-json.ts (Turkish) 11 months ago
qgc_json_zh_CN.ts New translations qgc-json.ts (Chinese Simplified) 11 months ago
qgc_ko_KR.ts New Crowdin updates (#10902) 11 months ago
qgc_ru_RU.ts New Crowdin updates (#10902) 11 months ago
qgc_source_az_AZ.ts New Crowdin updates (#11027) 11 months ago
qgc_source_bg_BG.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_de_DE.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_el_GR.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_es_ES.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_fi_FI.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_fr_FR.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_he_IL.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_it_IT.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_ja_JP.ts New Crowdin updates (#11027) 11 months ago
qgc_source_ko_KR.ts New translations qgc.ts (Korean) 11 months ago
qgc_source_nl_NL.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_no_NO.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_pl_PL.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_pt_PT.ts New Crowdin updates (#11027) 11 months ago
qgc_source_ru_RU.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_sv_SE.ts JoyStickButtonAssignment: Fix warning text 11 months ago
qgc_source_tr_TR.ts New translations qgc.ts (Turkish) 11 months ago
qgc_source_zh_CN.ts New translations qgc.ts (Chinese Simplified) 11 months ago
qgc_tr_TR.ts New Crowdin updates (#10902) 11 months ago
qgc_zh_CN.ts New Crowdin updates (#10902) 11 months ago

README.md

QGroundControl string translations

QGC uses the standard Qt Linguist mechanisms for string translation. QGC uses crowd sourced string translation through a Crowdin project for translation.

source qgc-lupdate.sh

Run this command to update the translations files for both Qt and Json. Crowdin will automatically pull these up and submit a pull request back when new translations are available.

C++ and Qml code strings

These are coded using the standard Qt tr() for C++ and qsTr() for Qml mechanisms.

Translating strings within Json files

QGC uses json files internally for metadata. These files need to be translated as well. There is a python json parser which is used to find all the json files in the source tree and pull all the strings out for translation. This parser outputs the localization file for json strings in Qt .ts file format.

In order for the parser to know which strings must be translated additional keys must be available at the root object level.

Important: Json files which have the same name are not allowed. Since the name is used as the context for the translation lookup it must be unique. The parse will throw an error if it finds duplicate file names.

Important: The root file name for the json file must be the same as the root filename for the Qt resource alias. This due to the fact that the root filename is used as the translation context. The json parser reads files from the file system and sees file system names. Whereas the QGC C++ code reads json files from the QT resource system and see the file alias as the full path and root name.

Specifying known file type

The parser supports two known file types: "MAVCmdInfo" and "FactMetaData". If your json file is one of these types you should place a fileType key at the root with one of these values. This will cause the parser to use these defaults for instructions:

MAVCmdInfo

    "translateKeys":    "label,enumStrings,friendlyName,description",
    "arrayIDKeys":      "rawName,comment"

FactMetaData

    "translateKeys":    "shortDescription,longDescription,enumStrings"
    "arrayIDKeys":      "name"

Manually specify parser instructions

For this case dont include the fileType key/value pair. And include the followings keys (as needed) in the root object:

  • translateKeys This key is a string which is a list of all the keys which should be translated.
  • arrayIDKeys The json localization parser provides additional information to the translator about where this string came from in the json hierarchy. If there is an array in the json, just displaying an array index as to where this came from is not that helpful. In most cases there is a key within each array element for which the value is unique. If this is the case then specify this key name(s) as the value for arrayIDKeys.

Disambiguation

This is used when you have two strings in the same file which are equal, but there meaning ar different enough that when translated they may each have their own different translation. In order to specific that you include a special prefix marker in the string which includes comments to the translator to explain the specifics of the string.

    "foo": "#loc.disambiguation#This is the foo version of baz#baz"
    "bar": "#loc.disambiguation#This is the bar version of baz#baz"

In the example above "baz" is the string which is the same for two different keys. The prefix #loc.disambiguation# indicates a disambiguation is to follow which is the string between the next set of #s.

Crowdin integration

Crowdin is configured to automatically sychronize the qgc.ts file once a day. So it will pick up any new changes automatically. Once it has processed those changes it will submit a pull request back with the translations.