I am working on a telemetry project which is a translator for Mavlink->FrSky using Teensy micro processor. The project provides not only visual telemetry but also calls out status text voice messages. Due to the low bandwidth on the SmartPort telemetry, the project originally opted to transfer these messages by assigning a number to each unique message, and have a corresponding wav file on the Taranis play when it received each number. I noticed since the release of 3.4 that many of the messages no longer play (the current code was written with 3.3 in mind). So today I started investigating the mechanism used in the code to call these messages out, and also figured out how the former dev on the project managed to determine what all the different status text messages are and how he managed to pull them into the teensy code.
He wrote a shell script to egrep through every AP file, scraping out all of the status text messages, severities etc, then another script to assigning the numbers, and generating the voice files using the voices provided on a mac. So in my investigations it made me realise that all of the status text messages are spread all over the place in AP - which made me wonder why it is done this way - hence my question on the dev forum.
Sorry if I come over as being naive, as I really haven’t taken a dive into the code until today, so I only have an overview of it so far, but this is my thought: I appreciate that status text messages will be triggered from every area of the code (almost), but what I can’t quite understand is why individual text messages are specified directly within the source code files - why not instead consolidate all the text messages in a language file (maybe an xml or csv file etc, and have the triggering code simply reference the relevant text entry in the language file (which would just pass a message ID parameter) instead? This way we would always have a language file containing a dictionary of every status text message used by AP. Maybe one consolidated collection of text messages for every version of AP. It would also mean different language files could be produced with translations.
The bottom line for me, is that it would always provide a single place for me to reference messages, instead of have scraper scripts to trawl folders of files dragging them out.