mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-18 06:50:35 +08:00
component information: add translation support
This commit is contained in:
@@ -53,7 +53,7 @@ else()
|
||||
set(comp_metadata_param_uri_fallback ${comp_metadata_param_uri_board})
|
||||
endif()
|
||||
# arguments: type, metadata file, uri, fallback uri, optional translation uri
|
||||
list(APPEND comp_metadata_types "--type" "1,${PX4_BINARY_DIR}/parameters.json.xz,${comp_metadata_param_uri},${comp_metadata_param_uri_fallback},")
|
||||
list(APPEND comp_metadata_types "--type" "1,${PX4_BINARY_DIR}/parameters.json.xz,${comp_metadata_param_uri},${comp_metadata_param_uri_fallback},https://raw.githubusercontent.com/PX4/PX4-Metadata-Translations/main/translated/parameters_summary.json")
|
||||
|
||||
|
||||
set(comp_metadata_events_uri_board "${s3_url}/Firmware/{version}/${comp_metadata_board}/all_events.json.xz")
|
||||
@@ -66,7 +66,7 @@ else()
|
||||
set(comp_metadata_events_uri "mftp://etc/extras/all_events.json.xz")
|
||||
set(comp_metadata_events_uri_fallback ${comp_metadata_events_uri_board})
|
||||
endif()
|
||||
list(APPEND comp_metadata_types "--type" "4,${PX4_BINARY_DIR}/events/all_events.json.xz,${comp_metadata_events_uri},${comp_metadata_events_uri_fallback},")
|
||||
list(APPEND comp_metadata_types "--type" "4,${PX4_BINARY_DIR}/events/all_events.json.xz,${comp_metadata_events_uri},${comp_metadata_events_uri_fallback},https://raw.githubusercontent.com/PX4/PX4-Metadata-Translations/main/translated/events_summary.json")
|
||||
|
||||
set(comp_metadata_actuators_uri_board "${s3_url}/Firmware/{version}/${comp_metadata_board}/actuators.json.xz")
|
||||
list(FIND config_romfs_extra_dependencies "actuators_json" index)
|
||||
|
||||
@@ -1,5 +1,47 @@
|
||||
{
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"translation": {
|
||||
"items": {
|
||||
"components": {
|
||||
"items": {
|
||||
"*": {
|
||||
"items": {
|
||||
"enums": {
|
||||
"items": {
|
||||
"*": {
|
||||
"items": {
|
||||
"entries": {
|
||||
"items": {
|
||||
"*": {
|
||||
"translate": [ "description" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event_groups": {
|
||||
"items": {
|
||||
"*": {
|
||||
"items": {
|
||||
"events": {
|
||||
"items": {
|
||||
"*": {
|
||||
"translate": [ "message", "description" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"1": {
|
||||
"namespace": "px4",
|
||||
|
||||
+1
-1
Submodule src/lib/events/libevents updated: 8d9c555127...48911e7be7
@@ -11,6 +11,32 @@ class JsonOutput():
|
||||
all_params=[]
|
||||
all_json['parameters']=all_params
|
||||
|
||||
all_json["translation"] = {
|
||||
"items": {
|
||||
"parameters": {
|
||||
"list": {
|
||||
"key": "name",
|
||||
"translate": [ "shortDesc", "longDesc" ],
|
||||
"translate-global": ["category", "group"],
|
||||
"items": {
|
||||
"bitmask": {
|
||||
"list": {
|
||||
"key": "index",
|
||||
"translate": [ "description" ]
|
||||
}
|
||||
},
|
||||
"values": {
|
||||
"list": {
|
||||
"key": "value",
|
||||
"translate": [ "description" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
schema_map = {
|
||||
"short_desc": "shortDesc",
|
||||
"long_desc": "longDesc",
|
||||
|
||||
Reference in New Issue
Block a user