rakhimov / scram

Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)
https://scram-pra.org
GNU General Public License v3.0
133 stars 54 forks source link

GUI: Translation setup for the core error messages #216

Closed rakhimov closed 6 years ago

rakhimov commented 7 years ago

Even though the core works with any locale and i18n for its input, the error messages are completely missing the translation code. For example, XML validation error messages are always in English. The XML (libxml2, libxml++) are translation unfriendly (e.g., no gettext setup).

The core needs to be translation aware with the help of gettext and boost::Locale. However, working around the XML library is going to be a major pain with its 100s of possible error messages.

rakhimov commented 6 years ago

The current complexity of XML, MEF, and model validation makes the core error message translation very laborious to achieve. It is a lot simpler to keep the analysis and validation core at C locale.

The GUI and other front-ends, on the other hand, are expected to localize error messages. The current SCRAM setup with boost::exception tags should provide enough structured information for the front-ends to construct their own descriptive error messages.

SCRAM error output to the standard error is also structured in YAML style so that the error data can be recovered as well.