mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-12-25 18:50:03 +01:00
i18n: fix typo in sorting entries
This commit is contained in:
parent
a64517c236
commit
287e3105a2
2 changed files with 4 additions and 2 deletions
|
|
@ -131,7 +131,7 @@ std::string CI18nEngine::localizeEntry(const std::string& locale, uint64_t key,
|
|||
return std::string{rawStr};
|
||||
|
||||
// build the new string. First, sort our entries
|
||||
std::ranges::sort(rangesFound, [](const auto& a, const auto& b) { return a.begin - b.begin; });
|
||||
std::ranges::sort(rangesFound, [](const auto& a, const auto& b) { return a.begin < b.begin; });
|
||||
|
||||
// calc the size
|
||||
size_t stringLen = 0;
|
||||
|
|
|
|||
|
|
@ -75,4 +75,6 @@ TEST(I18n, Engine) {
|
|||
EXPECT_EQ(engine.localizeEntry("ts", 42069 /* invalid key */, {{"count", "1"}}), "");
|
||||
|
||||
EXPECT_EQ(engine.localizeEntry("ts_TST", TXT_KEY_FALLBACK, {{"var1", "hi"}, {"var2", "!"}}), "Hello hi world !");
|
||||
}
|
||||
// Order shouldn't matter
|
||||
EXPECT_EQ(engine.localizeEntry("ts_TST", TXT_KEY_FALLBACK, {{"var2", "!"}, {"var1", "hi"}}), "Hello hi world !");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue