2017-04-13 08:45:58 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-04-13 08:45:58 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-04-13 08:45:58 +00:00
|
|
|
*/
|
|
|
|
#include "lang/lang_translator.h"
|
|
|
|
|
|
|
|
#include "lang/lang_keys.h"
|
2019-09-17 16:13:12 +00:00
|
|
|
#include "base/platform/base_platform_info.h"
|
2017-04-13 08:45:58 +00:00
|
|
|
|
|
|
|
namespace Lang {
|
|
|
|
|
|
|
|
QString Translator::translate(const char *context, const char *sourceText, const char *disambiguation, int n) const {
|
2022-11-26 21:20:17 +00:00
|
|
|
if (u"QMenuBar"_q == context) {
|
|
|
|
if (u"Services"_q == sourceText) return tr::lng_mac_menu_services(tr::now);
|
|
|
|
if (u"Hide %1"_q == sourceText) return tr::lng_mac_menu_hide_telegram(tr::now, lt_telegram, u"%1"_q);
|
|
|
|
if (u"Hide Others"_q == sourceText) return tr::lng_mac_menu_hide_others(tr::now);
|
|
|
|
if (u"Show All"_q == sourceText) return tr::lng_mac_menu_show_all(tr::now);
|
|
|
|
if (u"Preferences..."_q == sourceText) return tr::lng_mac_menu_preferences(tr::now);
|
|
|
|
if (u"Quit %1"_q == sourceText) return tr::lng_mac_menu_quit_telegram(tr::now, lt_telegram, u"%1"_q);
|
|
|
|
if (u"About %1"_q == sourceText) return tr::lng_mac_menu_about_telegram(tr::now, lt_telegram, u"%1"_q);
|
2017-04-13 08:45:58 +00:00
|
|
|
return QString();
|
|
|
|
}
|
2022-11-26 21:20:17 +00:00
|
|
|
if (u"QWidgetTextControl"_q == context || u"QLineEdit"_q == context) {
|
|
|
|
if (u"&Undo"_q == sourceText) return Platform::IsWindows() ? tr::lng_wnd_menu_undo(tr::now) : Platform::IsMac() ? tr::lng_mac_menu_undo(tr::now) : tr::lng_linux_menu_undo(tr::now);
|
|
|
|
if (u"&Redo"_q == sourceText) return Platform::IsWindows() ? tr::lng_wnd_menu_redo(tr::now) : Platform::IsMac() ? tr::lng_mac_menu_redo(tr::now) : tr::lng_linux_menu_redo(tr::now);
|
|
|
|
if (u"Cu&t"_q == sourceText) return tr::lng_mac_menu_cut(tr::now);
|
|
|
|
if (u"&Copy"_q == sourceText) return tr::lng_mac_menu_copy(tr::now);
|
|
|
|
if (u"&Paste"_q == sourceText) return tr::lng_mac_menu_paste(tr::now);
|
|
|
|
if (u"Delete"_q == sourceText) return tr::lng_mac_menu_delete(tr::now);
|
|
|
|
if (u"Select All"_q == sourceText) return tr::lng_mac_menu_select_all(tr::now);
|
2017-04-13 08:45:58 +00:00
|
|
|
return QString();
|
|
|
|
}
|
2022-11-26 21:20:17 +00:00
|
|
|
if (u"QUnicodeControlCharacterMenu"_q == context) {
|
|
|
|
if (u"Insert Unicode control character"_q == sourceText) return tr::lng_menu_insert_unicode(tr::now);
|
2017-04-13 08:45:58 +00:00
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Lang
|