-
Notifications
You must be signed in to change notification settings - Fork 161
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
I18n tracking : manually mark an item as being used #549
Comments
I believe you can use the https://github.com/danmayer/coverband/blob/main/lib/coverband/collectors/abstract_tracker.rb#L130 try adding a string that would be a regex to some keys you want to ignore and let me know if that works @Systho |
Oh but I do not want to ignore anything, more like the opposite. I actually want to track usage of keys in javascript, but since I'm not going through My point is to detect dead keys among the ones used in JS. |
hmm so if you are doing this manually ignore just means we won't try to report it as dead...but I get that isn't what you are looking for. I guess if you are looking for a programmatic way to do this you mean you want to dynamically call something that will mark the translation key? So from your controller take a param then call track on it... This is an example for the view tracker, but as you mentioned in the considered alternatives, i think calling track_key is the best.
not sure what else you would be looking for other than the |
Would you consider making Calling |
I could do something like that but it would likely have to at least specify the view_tracker vs i18n or others trackers. that could be by method name or something like a type: |
Is your feature request related to a problem? Please describe.
I am using i18n-js for expsing a subset of my i18n keys to my javascript code.
Those keys are never used by any ruby code but I would like to report from javascript when a key (or a set of keys) are used.
I can easily make an API controller or a Channel for this and send a message from javascript but then I do not know how to tell Coverband to mark it.
According to this file I would be inclined to use
Coverband.configuration.translations_tracker.track_key(flat_key)
but this does not really feel like a public APIHow can I do this ?
Describe the solution you'd like
In the best ever world, I wish the railtie would register a (safe) way to notify Coverband that a key has been used.
But in a more realistic world, I would love to a have public API available for marking a key as used (and possibly other entrypoint into Coverband )
Describe alternatives you've considered
Coverband.configuration.translations_tracker.track_key(flat_key)
: feels like using a private APIAdditional context
I could easily tune something for my use case, but I thought that I might not be the only one with this need
The text was updated successfully, but these errors were encountered: