Is your suggestion for improvement related to a problem? Please describe.
- I saw a ToDo in this unit test, said "TODO: Localization.lang(var1 + "test" + var2) not covered", and I want to finish it.
- I checked all strings in
Localization.lang parameter in repo now, only got string begin with ".
- It means we don't have case
Localization.lang(var + "test") or Localization.lang(var1 + "test" + var2) in repo, do I need to cover them when I finish the ToDo?
- I think only when developers need string concatenation in
Localization.lang would use Localization.lang(var + "test") and Localization.lang(var1 + "test" + var2)
Describe the solution you'd like
- one of these solution should work, not all of them.
- finish the ToDo, to cover future string concatenation case in
Localization.lang by add StringUtils.countMatches(e.getKey(), "\"") >= 2
assertTrue(e.getKey().startsWith("\"") || e.getKey().endsWith("\"") || StringUtils.countMatches(e.getKey(), "\"") >= 2, "Illegal localization parameter found. Must include a String with potential concatenation or replacement parameters. Illegal parameter: Localization.lang(" + e.getKey());
-
just fix comment without code change, such as delete the ToDo comment and add the link to https://devdocs.jabref.org/code-howtos/localization.html
-
fix the code by delete e.getKey().endsWith("\"")
assertTrue(e.getKey().startsWith("\""), "Illegal localization parameter found. Must include a String with potential concatenation or replacement parameters. Illegal parameter: Localization.lang(" + e.getKey());
Is your suggestion for improvement related to a problem? Please describe.
Localization.langparameter in repo now, only got string begin with ".Localization.lang(var + "test")orLocalization.lang(var1 + "test" + var2)in repo, do I need to cover them when I finish the ToDo?Localization.langwould useLocalization.lang(var + "test")andLocalization.lang(var1 + "test" + var2)Describe the solution you'd like
Localization.langby addStringUtils.countMatches(e.getKey(), "\"") >= 2just fix comment without code change, such as delete the ToDo comment and add the link to https://devdocs.jabref.org/code-howtos/localization.html
fix the code by delete
e.getKey().endsWith("\"")