-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Log a message when ResourceManagerStringLocalizer cannot find a resource #43109
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I think we need
If the team agreed to implement this feature, I'm ready to push a PR for it |
I just came across this because I am actually looking for a way to disable this behavior. Currently, when using LogLevel Debug, I get hundreds of messages like
These all exist and are not an indication of missing resx translation strings, it just merely reports everytime a XAML is parsed every single localization attempt. Can this be turned off in any way? |
Such logs are useful for debugging |
Yes, I did not question the usefulness. |
We might change this behavior to log when the resource is missing or follow the suggestion above |
@DamianEdwards do you agree with the above suggestion? |
@hishamco I think the simplest change would be to add a new log message that's emitted when a resource isn't found, probably at the debug level. If you want to send a PR for just that as a change I would think the team would be likely to accept it. |
If I'm not wrong there's already a log message with the debug level if the resource is not found. I think I did a long time ago, let me check now |
aspnetcore/src/Localization/Localization/src/ResourceManagerStringLocalizer.cs Lines 220 to 225 in e463a54
That's what you mean, right? |
@StepKie increase the log level, this is the matter of all debug logs :) |
As @Vivelin said in the issue description, that message doesn't indicate whether it was found or not, so I'm simply suggesting adding more messages to indicate the result of the search. |
Right, I will submit a PR for it |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I am trying to localize my app. For this I am using
IViewLocalizer
from Razor Pages, and this works pretty well. However, there is no easy way for me to see which resources I have yet to localize.Describe the solution you'd like
It would be incredibly helpful if there was a message that is logged when a string resource is missing and has yet to be localized.
A Debug-level message is logged when looking up resources:
aspnetcore/src/Localization/Localization/src/ResourceManagerStringLocalizer.cs
Line 195 in 363cdb1
This is a start, but this message does not distinguish between strings it found and those that were missing.
I can search through the code using Find in Files to find all places where I use
IStringLocalizer
,IViewLocalizer
and others, but that is error-prone and does not show me which ones have yet to be translated.Additional context
No response
The text was updated successfully, but these errors were encountered: