diff --git a/Tools/px4events/jsonout.py b/Tools/px4events/jsonout.py index f0644b0b86..6439047ddb 100644 --- a/Tools/px4events/jsonout.py +++ b/Tools/px4events/jsonout.py @@ -7,7 +7,7 @@ import os class JsonOutput(): def __init__(self, groups): all_json = {} - all_json['version'] = 1 + all_json['version'] = 2 component = {} all_json['components'] = {1: component} #1: autopilot component diff --git a/src/lib/component_information/CMakeLists.txt b/src/lib/component_information/CMakeLists.txt index 35acc1298d..f9b33e6d17 100644 --- a/src/lib/component_information/CMakeLists.txt +++ b/src/lib/component_information/CMakeLists.txt @@ -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) diff --git a/src/lib/events/enums.json b/src/lib/events/enums.json index ae45e9b934..ff8ed06511 100644 --- a/src/lib/events/enums.json +++ b/src/lib/events/enums.json @@ -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", diff --git a/src/lib/events/libevents b/src/lib/events/libevents index 8d9c555127..48911e7be7 160000 --- a/src/lib/events/libevents +++ b/src/lib/events/libevents @@ -1 +1 @@ -Subproject commit 8d9c5551273a52e22253ea6abf28d9e4b05e0ab7 +Subproject commit 48911e7be752a908a15d945b796ed8d8282b7b02 diff --git a/src/lib/parameters/px4params/jsonout.py b/src/lib/parameters/px4params/jsonout.py index 6e3338b980..a3ed2e9f09 100644 --- a/src/lib/parameters/px4params/jsonout.py +++ b/src/lib/parameters/px4params/jsonout.py @@ -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",