forked from forkgram/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen_branded_strings.patch
More file actions
62 lines (60 loc) · 2.24 KB
/
Copy pathcodegen_branded_strings.patch
File metadata and controls
62 lines (60 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/codegen/lang/generator.cpp b/codegen/lang/generator.cpp
index c12de72..be7d16f 100644
--- a/codegen/lang/generator.cpp
+++ b/codegen/lang/generator.cpp
@@ -183,6 +183,7 @@ struct phrase<" << tags.join(", ") << "> {\n\
}
void Generator::writeHeaderProducersInstances() {
+ auto indexesWithTelegram = std::vector<int>();
auto index = 0;
for (auto &entry : langpack_.entries) {
const auto isPlural = !entry.keyBase.isEmpty();
@@ -196,9 +197,49 @@ void Generator::writeHeaderProducersInstances() {
header_->stream() << "\
inline constexpr phrase<" << tags.join(", ") << "> " << (isPlural ? entry.keyBase : key) << "{ ushort(" << index << ") };\n";
}
+ const auto goodKey = [&](const QString &s) {
+ return entry.key.contains(s);
+ };
+ if (entry.value.contains("Telegram")
+ && (goodKey("_tray")
+ || goodKey("lng_tray_icon_text")
+ || goodKey("lng_error_start_minimized_passcoded")
+ || goodKey("lng_proxy_unsupported")
+ || goodKey("lng_bad_photo")
+ || goodKey("lng_update_telegram")
+ || goodKey("lng_sure_save_language")
+ || goodKey("lng_settings_auto_start")
+ || goodKey("lng_settings_add_sendto")
+ || goodKey("lng_theme_no_desktop")
+ || goodKey("lng_download_path_default_radio")
+ || goodKey("lng_passcode_about")
+ || goodKey("lng_proxy_sponsor_about")
+ || goodKey("lng_passcode_about")
+ || goodKey("lng_message_unsupported")
+ || goodKey("lng_bot_share_location_unavailable")
+ || goodKey("lng_new_version_wrap")
+ || goodKey("lng_theme_editor_need_unlock")
+ || goodKey("lng_payments_not_supported")
+ || goodKey("lng_group_call_mac_access")
+ || goodKey("lng_payments_not_supported")
+ || goodKey("lng_language_not_ready_about")
+ || goodKey("lng_outdated_")
+ || goodKey("lng_mac_menu_hide_")
+ )) {
+ indexesWithTelegram.push_back(index);
+ }
++index;
}
header_->newline();
+
+ ////////
+ auto indexesWithTelegramString = QString();
+ for (const auto &i : indexesWithTelegram) {
+ indexesWithTelegramString += QString::number(i) + ", ";
+ }
+ header_->stream() << "\
+inline constexpr std::array<int, " << indexesWithTelegram.size() << "> hasTelegram = {" << indexesWithTelegramString << " };\n";
+ header_->newline();
}
bool Generator::writeSource() {