New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some messages are still hardcoded in english #3110
Comments
Why this example is not enough ? Please share your problem |
@romani I am having a trouble in trying to understand what class to import to use localized messages. I was trying to follow how localized messages have been used elsewhere. But due to different implementations, I wasn't sure how to implement it. I just wanted a little more clarity. |
it is better to try another issue for you. |
@romani Okay but I give trying to solve the issue my best shot and if I fall short I'll work on a different issue. |
…sages and to support i18n for the messages
@subkrish , please proceed with hardcoded lines at:
|
@romani @rnveach Looks like the message for this
|
Yes.
That is what everyone does. No one in Checkstyle of us know all these languages. |
@romani @rnveach for the Main file changes should also be made to command line option that only print in english right?
|
no changes to CLI is required, behavior should be the same as Check messages:
|
… to support i18n for the messages
After some researching, I found out that maven runs the test in a separate forked process. Please look at this: |
I tried running this command ->
But when the same option ->
I don't understand the difference between the two. I was assuming both give the same result, either UTs fails or passes. EDIT: Looks like if the command is run as |
my PR is failed, that is good, please provide PR with fix for localized message |
…m DefaultLogger
…m DefaultLogger
@MANISH-K-07 , can you finish this issue for all other cases? after first PR , I think you can update all others in single PR, but you can do multiple, it is also good. Please create list of classes to update to let us easily track what is left to do. |
@romani , I have absolutely no problem with closing this issue in a single PR (or atmost 2-3). Although, please excuse me as I wanna ask you and @rnveach to re-confirm this.
Sure, I will post a ToDo list shortly.... |
I don't think you will repeat that massive update. You know all what is required to make this update, so it will be very technical and routine update for and us, as we already agreed on how to do this update. |
Pattern match gave me the following classes to update. TODO :
|
This comment was marked as duplicate.
This comment was marked as duplicate.
Thanks a lot copied to description. |
Regexp, we could use. PS: the regex mentioned above might not be exactly accurate, I will frame a proper one if the idea is all good. |
Can we do xpath Check usage? |
Well, I suppose we should be able to set a permanent query in MatchXpathCheck that runs parallely or smtg like checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java Lines 89 to 90 in 103d34f
|
Yep, regexp alone will be hacky and unreliable for this. We need a MatchXPath module that checks for string literal usage. |
This comment was marked as outdated.
This comment was marked as outdated.
scope should be only main folder, and all not user facing classes, should be added to suppression. Examples: XmlMetaReader, *Macro, XpathFileGeneratorAuditListener |
This comment was marked as outdated.
This comment was marked as outdated.
@MANISH-K-07 , please rephrase a question, I do not understand it. |
I don't exactly recall what my thought was back then.. Will brush up a bit and follow-up on this.. However, could we do new module for this after all existing strings are updated?.. to avoid extra suppressions |
CS still has some output events that are hardcoded in the code and are only in English. Some already have translations in message files, but we don't use them.
We translate check messages to their specific language so non-english users can understand the issue, we should do the same with every output of CS (minus XML attributes and such) so there is no confusion.
Examples:
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java
Lines 130 to 143 in e18195d
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/Main.java
Line 192 in e18195d
TODO :
JavadocPropertiesGeneratornot user facing, it is internal toolParentModuleMacronot user facing, it is internal toolPropertiesMacronot user facing, it is internal toolViolationMessagesMacronot user facing, it is internal toolXdocsTemplateParsernot user facing, it is internal toolXpathFileGeneratorAuditListenernot user facing, it is internal toolThe text was updated successfully, but these errors were encountered: