diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.h b/Telegram/SourceFiles/boxes/edit_privacy_box.h index 64aed7d6d4..1096d5f811 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.h +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.h @@ -11,8 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/sender.h" #include "apiwrap.h" -enum LangKey : int; - namespace Ui { class VerticalLayout; class FlatLabel; diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h index 4bd9dad02a..04e87308ab 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h @@ -15,8 +15,6 @@ class RoundButton; class VerticalLayout; } // namespace Ui -enum LangKey : int; - class EditPeerPermissionsBox : public BoxContent { public: EditPeerPermissionsBox(QWidget*, not_null peer); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.h b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.h index adcb70b3ca..767d8e7870 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.h @@ -10,8 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/abstract_box.h" #include "base/timer.h" -enum LangKey : int; - namespace style { struct InfoProfileCountButton; } // namespace style diff --git a/Telegram/SourceFiles/boxes/single_choice_box.h b/Telegram/SourceFiles/boxes/single_choice_box.h index 194d401357..876f44821f 100644 --- a/Telegram/SourceFiles/boxes/single_choice_box.h +++ b/Telegram/SourceFiles/boxes/single_choice_box.h @@ -10,8 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/abstract_box.h" #include -enum LangKey : int; - namespace Ui { class Radiobutton; } // namespace Ui diff --git a/Telegram/SourceFiles/codegen/lang/generator.cpp b/Telegram/SourceFiles/codegen/lang/generator.cpp index 75a6e993fe..cdd8fef248 100644 --- a/Telegram/SourceFiles/codegen/lang/generator.cpp +++ b/Telegram/SourceFiles/codegen/lang/generator.cpp @@ -106,7 +106,6 @@ bool Generator::writeHeader() { writeHeaderForwardDeclarations(); writeHeaderTagTypes(); - writeHeaderKeyType(); writeHeaderInterface(); writeHeaderReactiveInterface(); writeHeaderTaggedMethods(); @@ -117,11 +116,10 @@ bool Generator::writeHeader() { void Generator::writeHeaderForwardDeclarations() { header_->pushNamespace("Lang").stream() << "\ \n\ -inline constexpr auto kTagsCount = " << langpack_.tags.size() << ";\n\ +inline constexpr ushort kTagsCount = " << langpack_.tags.size() << ";\n\ +inline constexpr ushort kKeysCount = " << langpack_.entries.size() << ";\n\ \n"; - - header_->popNamespace().newline().stream() << "\ -enum LangKey : int;\n\n"; + header_->popNamespace().newline(); } void Generator::writeHeaderTagTypes() { @@ -143,19 +141,6 @@ void Generator::writeHeaderTagTypes() { header_->newline(); } -void Generator::writeHeaderKeyType() { - header_->stream() << "\ -enum LangKey : int {\n"; - for (auto &entry : langpack_.entries) { - header_->stream() << "\t" << getFullKey(entry) << ",\n"; - } - header_->stream() << "\ -\n\ - kLangKeysCount,\n\ -};\n\ -\n"; -} - void Generator::writeHeaderTaggedMethods() { for (auto &entry : langpack_.entries) { auto isPlural = !entry.keyBase.isEmpty(); @@ -181,9 +166,9 @@ void Generator::writeHeaderInterface() { header_->pushNamespace("Lang").stream() << "\ \n\ ushort GetTagIndex(QLatin1String tag);\n\ -LangKey GetKeyIndex(QLatin1String key);\n\ -bool IsTagReplaced(LangKey key, ushort tag);\n\ -QString GetOriginalValue(LangKey key);\n\ +ushort GetKeyIndex(QLatin1String key);\n\ +bool IsTagReplaced(ushort key, ushort tag);\n\ +QString GetOriginalValue(ushort key);\n\ \n"; writeHeaderTagValueLookup(); header_->popNamespace().newline(); @@ -286,7 +271,7 @@ struct phrase<" << tags.join(", ") << "> {\n\ return ::Lang::details::Producer<" << tags.join(", ") << ">::template Current(" << values.join(", ") << ");\n\ }\n\ \n\ - LangKey base;\n\ + ushort base;\n\ };\n\ \n"; } @@ -304,17 +289,29 @@ void Generator::writeHeaderProducersInstances() { } if (!isPlural || key == ComputePluralKey(entry.keyBase, 0)) { header_->stream() << "\ -inline constexpr phrase<" << tags.join(", ") << "> " << (isPlural ? entry.keyBase : key) << "{ LangKey(" << index << ") };\n"; +inline constexpr phrase<" << tags.join(", ") << "> " << (isPlural ? entry.keyBase : key) << "{ ushort(" << index << ") };\n"; } ++index; } header_->newline(); } +void Generator::writeSourceLangKeyConstants() { + auto index = 0; + for (auto &entry : langpack_.entries) { + source_->stream() << "constexpr auto " << getFullKey(entry) << " = ushort(" << (index++) << ");\n"; + } + source_->newline(); +} + bool Generator::writeSource() { source_ = std::make_unique(basePath_ + ".cpp", project_); - source_->include("lang/lang_keys.h").pushNamespace("Lang").pushNamespace().stream() << "\ + source_->include("lang/lang_keys.h").pushNamespace("Lang").pushNamespace(); + + writeSourceLangKeyConstants(); + + source_->stream() << "\ \n\ QChar DefaultData[] = {"; auto count = 0; @@ -375,7 +372,7 @@ ushort GetTagIndex(QLatin1String tag) {\n\ source_->stream() << "\ }\n\ \n\ -LangKey GetKeyIndex(QLatin1String key) {\n\ +ushort GetKeyIndex(QLatin1String key) {\n\ auto size = key.size();\n\ auto data = key.data();\n"; @@ -397,15 +394,16 @@ LangKey GetKeyIndex(QLatin1String key) {\n\ } } - writeSetSearch(keysSet, [&taggedKeys](const QString &key) { + writeSetSearch(keysSet, [&](const QString &key) { auto it = taggedKeys.find(key); return (it != taggedKeys.end()) ? it->second : key; - }, "kLangKeysCount"); + }, "kKeysCount"); + header_->popNamespace().newline(); source_->stream() << "\ }\n\ \n\ -bool IsTagReplaced(LangKey key, ushort tag) {\n\ +bool IsTagReplaced(ushort key, ushort tag) {\n\ switch (key) {\n"; auto lastWrittenPluralEntry = QString(); @@ -444,9 +442,10 @@ bool IsTagReplaced(LangKey key, ushort tag) {\n\ return false;\n\ }\n\ \n\ -QString GetOriginalValue(LangKey key) {\n\ - Expects(key >= 0 && key < kLangKeysCount);\n\ - auto offset = Offsets[key];\n\ +QString GetOriginalValue(ushort key) {\n\ + Expects(key >= 0 && key < kKeysCount);\n\ +\n\ + const auto offset = Offsets[key];\n\ return QString::fromRawData(DefaultData + offset, Offsets[key + 1] - offset);\n\ }\n\ \n"; diff --git a/Telegram/SourceFiles/codegen/lang/generator.h b/Telegram/SourceFiles/codegen/lang/generator.h index 958ac23a38..f7f6d07083 100644 --- a/Telegram/SourceFiles/codegen/lang/generator.h +++ b/Telegram/SourceFiles/codegen/lang/generator.h @@ -31,7 +31,6 @@ public: private: void writeHeaderForwardDeclarations(); void writeHeaderTagTypes(); - void writeHeaderKeyType(); void writeHeaderTaggedMethods(); void writeHeaderInterface(); void writeHeaderTagValueLookup(); @@ -39,6 +38,8 @@ private: void writeHeaderProducersInterface(); void writeHeaderProducersInstances(); + void writeSourceLangKeyConstants(); + QString getFullKey(const LangPack::Entry &entry); template diff --git a/Telegram/SourceFiles/data/data_peer.h b/Telegram/SourceFiles/data/data_peer.h index df8ef07864..f652716169 100644 --- a/Telegram/SourceFiles/data/data_peer.h +++ b/Telegram/SourceFiles/data/data_peer.h @@ -11,8 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_flags.h" #include "data/data_notify_settings.h" -enum LangKey : int; - namespace Ui { class EmptyUserpic; } // namespace Ui diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 960fdf4550..d7be48f110 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -23,7 +23,6 @@ struct SendingAlbum; enum class SendMediaType; enum class CompressConfirm; class MessageLinksParser; -enum LangKey : int; namespace InlineBots { namespace Layout { diff --git a/Telegram/SourceFiles/intro/introwidget.cpp b/Telegram/SourceFiles/intro/introwidget.cpp index 30054cf3b9..b9e1497694 100644 --- a/Telegram/SourceFiles/intro/introwidget.cpp +++ b/Telegram/SourceFiles/intro/introwidget.cpp @@ -149,17 +149,19 @@ void Widget::createLanguageLink() { const auto defaultId = Lang::DefaultLanguageId(); const auto suggested = Lang::CurrentCloudManager().suggestedLanguage(); if (currentId != defaultId) { - createLink(Lang::GetOriginalValue(lng_switch_to_this), defaultId); + createLink( + Lang::GetOriginalValue(tr::lng_switch_to_this.base), + defaultId); } else if (!suggested.isEmpty() && suggested != currentId) { request(MTPlangpack_GetStrings( MTP_string(Lang::CloudLangPackName()), MTP_string(suggested), MTP_vector(1, MTP_string("lng_switch_to_this")) )).done([=](const MTPVector &result) { - auto strings = Lang::Instance::ParseStrings(result); - auto it = strings.find(lng_switch_to_this); - if (it != strings.end()) { - createLink(it->second, suggested); + const auto strings = Lang::Instance::ParseStrings(result); + const auto i = strings.find(tr::lng_switch_to_this.base); + if (i != strings.end()) { + createLink(i->second, suggested); } }).send(); } diff --git a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp index d7ef7005c5..0c7a8a2179 100644 --- a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp +++ b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp @@ -468,7 +468,7 @@ void CloudManager::switchToLanguage(const Language &data) { )).done([=](const MTPVector &result) { _switchingToLanguageRequest = 0; const auto values = Instance::ParseStrings(result); - const auto getValue = [&](LangKey key) { + const auto getValue = [&](ushort key) { auto it = values.find(key); return (it == values.cend()) ? GetOriginalValue(key) @@ -476,7 +476,7 @@ void CloudManager::switchToLanguage(const Language &data) { }; const auto text = tr::lng_sure_save_language(tr::now) + "\n\n" - + getValue(lng_sure_save_language); + + getValue(tr::lng_sure_save_language.base); Ui::show( Box( text, @@ -498,15 +498,17 @@ void CloudManager::performSwitchToCustom() { return; } - auto filePath = result.paths.front(); - Lang::FileParser loader(filePath, { lng_sure_save_language }); + const auto filePath = result.paths.front(); + auto loader = Lang::FileParser( + filePath, + { tr::lng_sure_save_language.base }); if (loader.errors().isEmpty()) { weak->request(weak->_switchingToLanguageRequest).cancel(); if (weak->canApplyWithoutRestart(qsl("#custom"))) { weak->_langpack.switchToCustomFile(filePath); } else { const auto values = loader.found(); - const auto getValue = [&](LangKey key) { + const auto getValue = [&](ushort key) { const auto it = values.find(key); return (it == values.cend()) ? GetOriginalValue(key) @@ -514,7 +516,7 @@ void CloudManager::performSwitchToCustom() { }; const auto text = tr::lng_sure_save_language(tr::now) + "\n\n" - + getValue(lng_sure_save_language); + + getValue(tr::lng_sure_save_language.base); const auto change = [=] { weak->_langpack.switchToCustomFile(filePath); App::restart(); diff --git a/Telegram/SourceFiles/lang/lang_file_parser.cpp b/Telegram/SourceFiles/lang/lang_file_parser.cpp index 27253eb111..f1d0852dcd 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.cpp +++ b/Telegram/SourceFiles/lang/lang_file_parser.cpp @@ -16,7 +16,7 @@ constexpr auto kLangFileLimit = 1024 * 1024; } // namespace -FileParser::FileParser(const QString &file, const std::set &request) +FileParser::FileParser(const QString &file, const std::set &request) : _content(base::parse::stripComments(ReadFile(file, file))) , _request(request) { parse(); @@ -90,7 +90,7 @@ bool FileParser::readKeyValue(const char *&from, const char *end) { } auto skipping = false; - auto keyIndex = kLangKeysCount; + auto keyIndex = kKeysCount; if (!_callback) { keyIndex = GetKeyIndex(key); skipping = (_request.find(keyIndex) == _request.end()); diff --git a/Telegram/SourceFiles/lang/lang_file_parser.h b/Telegram/SourceFiles/lang/lang_file_parser.h index cf0dcd4de5..f7fb1fb912 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.h +++ b/Telegram/SourceFiles/lang/lang_file_parser.h @@ -13,9 +13,9 @@ namespace Lang { class FileParser { public: - using Result = QMap; + using Result = QMap; - FileParser(const QString &file, const std::set &request); + FileParser(const QString &file, const std::set &request); FileParser(const QByteArray &content, Fn callback); static QByteArray ReadFile(const QString &absolutePath, const QString &relativePath); @@ -43,7 +43,7 @@ private: mutable QString _errors, _warnings; const QByteArray _content; - const std::set _request; + const std::set _request; const Fn _callback; Result _result; diff --git a/Telegram/SourceFiles/lang/lang_instance.cpp b/Telegram/SourceFiles/lang/lang_instance.cpp index 36245aaa73..f5fbee23ca 100644 --- a/Telegram/SourceFiles/lang/lang_instance.cpp +++ b/Telegram/SourceFiles/lang/lang_instance.cpp @@ -27,9 +27,9 @@ constexpr auto kLangValuesLimit = 20000; std::vector PrepareDefaultValues() { auto result = std::vector(); - result.reserve(kLangKeysCount); - for (auto i = 0; i != kLangKeysCount; ++i) { - result.emplace_back(GetOriginalValue(LangKey(i))); + result.reserve(kKeysCount); + for (auto i = 0; i != kKeysCount; ++i) { + result.emplace_back(GetOriginalValue(ushort(i))); } return result; } @@ -38,7 +38,7 @@ class ValueParser { public: ValueParser( const QByteArray &key, - LangKey keyIndex, + ushort keyIndex, const QByteArray &value); QString takeResult() { @@ -55,7 +55,7 @@ private: bool readTag(); const QByteArray &_key; - LangKey _keyIndex = kLangKeysCount; + ushort _keyIndex = kKeysCount; QLatin1String _currentTag; ushort _currentTagIndex = 0; @@ -72,7 +72,10 @@ private: }; -ValueParser::ValueParser(const QByteArray &key, LangKey keyIndex, const QByteArray &value) +ValueParser::ValueParser( + const QByteArray &key, + ushort keyIndex, + const QByteArray &value) : _key(key) , _keyIndex(keyIndex) , _currentTag("") @@ -196,7 +199,7 @@ void ParseKeyValue( const QByteArray &value, Save &&save) { const auto index = GetKeyIndex(QLatin1String(key)); - if (index != kLangKeysCount) { + if (index != kKeysCount) { ValueParser parser(key, index, value); if (parser.parse()) { save(index, parser.takeResult()); @@ -240,12 +243,12 @@ struct Instance::PrivateTag { Instance::Instance() : _values(PrepareDefaultValues()) -, _nonDefaultSet(kLangKeysCount, 0) { +, _nonDefaultSet(kKeysCount, 0) { } Instance::Instance(not_null derived, const PrivateTag &) : _derived(derived) -, _nonDefaultSet(kLangKeysCount, 0) { +, _nonDefaultSet(kKeysCount, 0) { } void Instance::switchToId(const Language &data) { @@ -298,7 +301,7 @@ void Instance::reset(const Language &data) { _version = 0; _nonDefaultValues.clear(); for (auto i = 0, count = int(_values.size()); i != count; ++i) { - _values[i] = GetOriginalValue(LangKey(i)); + _values[i] = GetOriginalValue(ushort(i)); } ranges::fill(_nonDefaultSet, 0); @@ -340,12 +343,14 @@ QString Instance::baseId() const { } QString Instance::name() const { - return _name.isEmpty() ? getValue(lng_language_name) : _name; + return _name.isEmpty() + ? getValue(tr::lng_language_name.base) + : _name; } QString Instance::nativeName() const { return _nativeName.isEmpty() - ? getValue(lng_language_name) + ? getValue(tr::lng_language_name.base) : _nativeName; } @@ -719,17 +724,17 @@ void Instance::applyDifferenceToMe( } } -std::map Instance::ParseStrings( +std::map Instance::ParseStrings( const MTPVector &strings) { - auto result = std::map(); + auto result = std::map(); for (const auto &string : strings.v) { HandleString(string, [&](auto &&key, auto &&value) { - ParseKeyValue(key, value, [&](LangKey key, QString &&value) { + ParseKeyValue(key, value, [&](ushort key, QString &&value) { result[key] = std::move(value); }); }, [&](auto &&key) { auto keyIndex = GetKeyIndex(QLatin1String(key)); - if (keyIndex != kLangKeysCount) { + if (keyIndex != kKeysCount) { result.erase(keyIndex); } }); @@ -748,7 +753,7 @@ QString Instance::getNonDefaultValue(const QByteArray &key) const { void Instance::applyValue(const QByteArray &key, const QByteArray &value) { _nonDefaultValues[key] = value; - ParseKeyValue(key, value, [&](LangKey key, QString &&value) { + ParseKeyValue(key, value, [&](ushort key, QString &&value) { _nonDefaultSet[key] = 1; if (!_derived) { _values[key] = std::move(value); @@ -773,7 +778,7 @@ void Instance::resetValue(const QByteArray &key) { _nonDefaultValues.erase(key); const auto keyIndex = GetKeyIndex(QLatin1String(key)); - if (keyIndex != kLangKeysCount) { + if (keyIndex != kKeysCount) { _nonDefaultSet[keyIndex] = 0; if (!_derived) { const auto base = _base @@ -794,11 +799,11 @@ Instance &Current() { namespace details { -QString Current(LangKey key) { +QString Current(ushort key) { return Lang::Current().getValue(key); } -rpl::producer Viewer(LangKey key) { +rpl::producer Viewer(ushort key) { return rpl::single( Lang::Current().getValue(key) ) | then(base::ObservableViewer( diff --git a/Telegram/SourceFiles/lang/lang_instance.h b/Telegram/SourceFiles/lang/lang_instance.h index a3ca475c88..7ce7b8c7ee 100644 --- a/Telegram/SourceFiles/lang/lang_instance.h +++ b/Telegram/SourceFiles/lang/lang_instance.h @@ -96,19 +96,19 @@ public: void applyDifference( Pack pack, const MTPDlangPackDifference &difference); - static std::map ParseStrings( + static std::map ParseStrings( const MTPVector &strings); base::Observable &updated() { return _updated; } - QString getValue(LangKey key) const { + QString getValue(ushort key) const { Expects(key >= 0 && key < _values.size()); return _values[key]; } QString getNonDefaultValue(const QByteArray &key) const; - bool isNonDefaultPlural(LangKey key) const { + bool isNonDefaultPlural(ushort key) const { Expects(key >= 0 && key + 5 < _nonDefaultSet.size()); return _nonDefaultSet[key] @@ -163,8 +163,8 @@ private: namespace details { -QString Current(LangKey key); -rpl::producer Viewer(LangKey key); +QString Current(ushort key); +rpl::producer Viewer(ushort key); } // namespace details } // namespace Lang diff --git a/Telegram/SourceFiles/lang/lang_tag.cpp b/Telegram/SourceFiles/lang/lang_tag.cpp index 88fd4e5aa1..9f8fadef46 100644 --- a/Telegram/SourceFiles/lang/lang_tag.cpp +++ b/Telegram/SourceFiles/lang/lang_tag.cpp @@ -963,7 +963,7 @@ PluralResult Plural( const auto t = f; const auto useNonDefaultPlural = (ChoosePlural != ChoosePluralDefault) - && Lang::Current().isNonDefaultPlural(LangKey(keyBase)); + && Lang::Current().isNonDefaultPlural(keyBase); const auto shift = (useNonDefaultPlural ? ChoosePlural : ChoosePluralDefault)( (integer ? i : -1), i, diff --git a/Telegram/SourceFiles/lang/lang_values.h b/Telegram/SourceFiles/lang/lang_values.h index 7b35734e11..abe715f1b7 100644 --- a/Telegram/SourceFiles/lang/lang_values.h +++ b/Telegram/SourceFiles/lang/lang_values.h @@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_tag.h" -enum LangKey : int; enum lngtag_count : int; namespace Lang { @@ -20,8 +19,8 @@ inline constexpr auto kPluralCount = 6; template inline constexpr ushort TagValue(); -QString Current(LangKey key); -rpl::producer Viewer(LangKey key); +QString Current(ushort key); +rpl::producer Viewer(ushort key); template Type ReplaceUnwrapTuple(Type accumulated, const Tuple &tuple) { @@ -76,7 +75,7 @@ struct Producer { typename P, typename T = decltype(std::declval

()(QString())), typename ...Values> - static rpl::producer Combine(LangKey base, P p, Values &...values) { + static rpl::producer Combine(ushort base, P p, Values &...values) { return rpl::combine( Viewer(base), std::move(values)... @@ -89,7 +88,7 @@ struct Producer { typename P, typename T = decltype(std::declval

()(QString())), typename ...Values> - static T Current(LangKey base, P p, const Values &...values) { + static T Current(ushort base, P p, const Values &...values) { return ReplaceUnwrap::template Call( p(Lang::details::Current(base)), values...); @@ -101,14 +100,14 @@ struct Producer<> { template < typename P, typename T = decltype(std::declval

()(QString()))> - static rpl::producer Combine(LangKey base, P p) { + static rpl::producer Combine(ushort base, P p) { return Viewer(base) | rpl::map(std::move(p)); } template < typename P, typename T = decltype(std::declval

()(QString()))> - static T Current(LangKey base, P p) { + static T Current(ushort base, P p) { return p(Lang::details::Current(base)); } }; @@ -120,18 +119,18 @@ struct Producer { typename T = decltype(std::declval

()(QString())), typename ...Values> static rpl::producer Combine( - LangKey base, + ushort base, P p, lngtag_count type, rpl::producer &count, Values &...values) { return rpl::combine( Viewer(base), - Viewer(LangKey(base + 1)), - Viewer(LangKey(base + 2)), - Viewer(LangKey(base + 3)), - Viewer(LangKey(base + 4)), - Viewer(LangKey(base + 5)), + Viewer(base + 1), + Viewer(base + 2), + Viewer(base + 3), + Viewer(base + 4), + Viewer(base + 5), std::move(count), std::move(values)... ) | rpl::map([base, type, p = std::move(p)](auto tuple) { @@ -163,7 +162,7 @@ struct Producer { typename T = decltype(std::declval

()(QString())), typename ...Values> static T Current( - LangKey base, + ushort base, P p, lngtag_count type, float64 count, @@ -171,7 +170,7 @@ struct Producer { auto plural = Plural(base, count, type); return ReplaceUnwrap::template Call( ReplaceTag::Call( - p(Lang::details::Current(LangKey(base + plural.keyShift))), + p(Lang::details::Current(base + plural.keyShift)), TagValue(), StartReplacements::Call( std::move(plural.replacement))),