-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
made CORE_SRX_RULES_UNKNOWN_LANGUAGE_CODE log message better readable… #1158
made CORE_SRX_RULES_UNKNOWN_LANGUAGE_CODE log message better readable… #1158
Conversation
… by surrounding the faulty language code with quotes
Nice catch. Would you mind changing the other bundles as well? But the wording itself is strange. Why "unkown language code"? What does that refer to? |
french already had parentheses around the code and my editor only showed me escaped unicode for the japanese (where i imagine the code pops out naturally in contrast with kana and kanji) and no other bundles contained that string. so, thanks for asking but no thanks ^_^
this seems to only happen when there is something strange at the very bottom of the segmentation rules like this: |
What this shows is that the problematic "language code" is the second before last. And there is no "language code" attribute to that |
unclear where that languagerulename value came from, i probably typed something stupid when getting to know Ωt years ago and left it there because it never bothered me until now (had to finally convert from legacy version to current one). i am also unsure why the rule name should comply with language codes or names. possibly this was not the intended effect of that method, but this PR is only about readability of the log message itself, not about when or why it is emitted, the author of that lambda expression could maybe have a look at that. |
@zs-stpa A
You report a situation with some rule file which may have a difference with @brandelune we should not change just for the message, but we need to understand what is the root cause of the problem. Current rule detection logic uses a comparison in localized rule names. Please check
|
A message has been introduced in #539 |
In a discussion with @t-cordonnier previous CONF file uses localized rule names We have a space to improve it without localized names but with the standard code. |
A line of
have been changed by L10N project for v5.5, from
in 9, May, 2021 at commit 293c930#diff-a0b5e935869c4620cf942b3b73226a631b3f7dafd7f028386e369425a665c00d Your rule file may be generated in pre-v5.5 days. |
sorry for using screenshots instead of plain text. yes the segmentation.conf file is from an ancient version, 3.6.0_10 i believe, and the error message occurs when converting the old style team project to a new style project with segmentation.srx. in this case, the rule with the offending name is totally redundant, and i think it is a little bit strange that the name of the segmentation rule groups should conform to locale naming conventions. i am not that familiar with lambda expressions, but in my last screenshot of the debugger i can see in the lower left corner that the call to that error message comes from within a lambda expression, which is expanded for readability in the box on the right hand side. so the mapping rule is calling getLanguageCodeByName(code) with what should be just a human readable name instead of a code, since that exact name is a localized string from an earlier version as you have pointed out. |
I think the message defined as "CORE_SRX_RULES_UNKNOWN_LANGUAGE_CODE" is like a debug purpose.
|
… by surrounding the faulty language code with quotes.
this only touches localized variants of the string, no code changes at all.
this is how it looked prior to the change with the example faulty language code 'Segmentierung der Textdateien'