Skip to content

Commit

Permalink
Don't complain about "%d%%" being exposed for translation
Browse files Browse the repository at this point in the history
This is fine, as translators can move the %% to the front
  • Loading branch information
Blake-Madden committed Jan 5, 2025
1 parent aec711c commit d2ee6c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/i18n_review.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,11 @@ namespace i18n_check
}
}
string_util::trim(strToReview);
// something like "%d%%" should be translatable
if (strToReview == L"%%")
{
return std::make_pair(false, strToReview.length());
}

try
{
Expand Down
1 change: 1 addition & 0 deletions tests/i18nstringtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ TEST_CASE("untranslatable", "[i18nreview]")
CHECK_FALSE(reviewer.is_untranslatable_string(L"100%", false).first);
CHECK_FALSE(reviewer.is_untranslatable_string(L"{n}%", false).first);
CHECK_FALSE(reviewer.is_untranslatable_string(L"%d%", false).first);
CHECK_FALSE(reviewer.is_untranslatable_string(L"%d%%", false).first);
// HTML anchors
CHECK(reviewer.is_untranslatable_string(L"#something", false).first);
CHECK(reviewer.is_untranslatable_string(L"#Something-else", false).first);
Expand Down

0 comments on commit d2ee6c5

Please sign in to comment.