setOrganizationDomain("sigrok.org");
}
-QStringList Application::get_languages()
+const QStringList Application::get_languages() const
{
QStringList files = QDir(":/l10n/").entryList(QStringList("*.qm"), QDir::Files);
return result;
}
+const QString Application::get_language_editors(const QString& language) const
+{
+ if (language == "de") return "Sören Apel, Uwe Hermann";
+ if (language == "es_mx") return "Carlos Diaz";
+
+ return QString();
+}
+
void Application::switch_language(const QString& language)
{
removeTranslator(&app_translator_);
public:
Application(int &argc, char* argv[]);
- QStringList get_languages();
+ const QStringList get_languages() const;
+ const QString get_language_editors(const QString& language) const;
void switch_language(const QString& language);
+
void on_setting_changed(const QString &key, const QVariant &value);
void collect_version_info(shared_ptr<sigrok::Context> context);
QString current_language = settings.value(GlobalSettings::Key_General_Language).toString();
for (const QString& language : a->get_languages()) {
- QLocale locale = QLocale(language);
- QString desc = locale.languageToString(locale.language());
+ const QLocale locale = QLocale(language);
+ const QString desc = locale.languageToString(locale.language());
language_cb->addItem(desc, language);
if (language == current_language) {
.arg(entry.first, entry.second));
#endif
+ s.append("<tr><td colspan=\"2\"></td></tr>");
+ s.append("<tr><td colspan=\"2\"><b>" +
+ tr("Available Translations:") + "</b></td></tr>");
+ for (const QString& language : a->get_languages()) {
+ if (language == "en")
+ continue;
+
+ const QLocale locale = QLocale(language);
+ const QString desc = locale.languageToString(locale.language());
+ const QString editors = a->get_language_editors(language);
+
+ s.append(QString("<tr><td class=\"id\"><i>%1</i></td><td>(%2)</td></tr>")
+ .arg(desc, editors));
+ }
+
s.append("</table>");
QTextDocument *supported_doc = new QTextDocument();