44 lines
1.1 KiB
Plaintext
Executable File
44 lines
1.1 KiB
Plaintext
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Convert DSS enumerations to translatable strings
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
{% autoescape off %}
|
|
// filename: {{ namespace_abbr }}_translation.cpp
|
|
|
|
#include "{{ namespace_abbr }}_translation.h"
|
|
#include <QCoreApplication>
|
|
|
|
namespace {{ namespace }}
|
|
{
|
|
{% for idl_enum in idl_enums %}
|
|
//
|
|
// {{ idl_enum.name }}
|
|
//
|
|
QString toString({{ idl_enum.name }} state)
|
|
{
|
|
switch(state.underlying())
|
|
{{% for idl_member in idl_enum.member %}
|
|
case {{ idl_enum.name }}::{{ idl_member.key }}: return QCoreApplication::translate("{{ idl_enum.name }}", "{{ idl_member.key }}");
|
|
{% endfor %}
|
|
default: break;
|
|
}
|
|
return QCoreApplication::translate("{{ idl_enum.name }}", "Unknown (%1)").arg(state.underlying());
|
|
}
|
|
{% endfor %}
|
|
|
|
{% for dt in dataTopics.member %}{% if dt.hasTrColumns %}{% for tr in dt.trColumns %}
|
|
// {{ dt.name }}::{{ tr.name }}
|
|
QString tr{{ dt.name }}{{ tr.nameCc }}(const std::string &text)
|
|
{
|
|
return QCoreApplication::translate("{{ dt.name }}", text.c_str(), "{{ tr.name }}");
|
|
}
|
|
{% endfor %}{% endif %}{% endfor %}
|
|
|
|
} // namespace {{ namespace }}
|
|
|
|
{% endautoescape %}
|