Generate correct lang tag count, not hardcoded.
This commit is contained in:
parent
670a725c53
commit
dd005d9027
|
@ -32,6 +32,8 @@ namespace codegen {
|
||||||
namespace lang {
|
namespace lang {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kMaxPluralVariants = 6;
|
||||||
|
|
||||||
char hexChar(uchar ch) {
|
char hexChar(uchar ch) {
|
||||||
if (ch < 10) {
|
if (ch < 10) {
|
||||||
return '0' + ch;
|
return '0' + ch;
|
||||||
|
@ -139,8 +141,8 @@ LangString langCounted(ushort key0, ushort tag, float64 value);\n\
|
||||||
}
|
}
|
||||||
header_->stream() << "\
|
header_->stream() << "\
|
||||||
\n\
|
\n\
|
||||||
constexpr auto lngtags_cnt = 70;\n\
|
constexpr auto lngtags_cnt = " << langpack_.tags.size() << ";\n\
|
||||||
constexpr auto lngtags_max_counted_values = 6;\n\
|
constexpr auto lngtags_max_counted_values = " << kMaxPluralVariants << ";\n\
|
||||||
\n\
|
\n\
|
||||||
enum LangKey {\n";
|
enum LangKey {\n";
|
||||||
for (auto &entry : langpack_.entries) {
|
for (auto &entry : langpack_.entries) {
|
||||||
|
|
Loading…
Reference in New Issue