You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm talking about the following snippet from the default config file:
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,## e.g. in case of a relative key defined in a helper method.## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:## <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',# only: %w(*.html.haml *.html.slim),# patterns: [['= title\b', '.page_title']] %>## The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:## <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
I wanted to map = change_locale_link(%{key}) in slim templates to keys in the form shared.locale.%{key}. Using the examples from the snippet, I have come with the following code:
This results in the NameError uninitialized constant I18n::Tasks::Scanners::PatternMapper when invoking any i18n-tasks command or running the spec. As a temporal solution, loading the file which contains PatternMapper worked for me:
The title of this issue states the name of the constant to be I18n::Tasks::Scanner::PatternMapper, but then everywhere else you say it is I18n::Tasks::Scanners::PatternMapper (Scanner vs Scanners), which is the right one. Could you confirm that the right one is in use in the case where you get an error?
smaximov
changed the title
I18n::Tasks::Scanner::PatternMapper is undefined when loading config fileI18n::Tasks::Scanners::PatternMapper is undefined when loading config file
Oct 5, 2016
I'm talking about the following snippet from the default config file:
I wanted to map
= change_locale_link(%{key})
in slim templates to keys in the formshared.locale.%{key}
. Using the examples from the snippet, I have come with the following code:This results in the NameError
uninitialized constant I18n::Tasks::Scanners::PatternMapper
when invoking any i18n-tasks command or running the spec. As a temporal solution, loading the file which containsPatternMapper
worked for me:ruby v2.3.1, i18n-tasks v0.9.5.
The text was updated successfully, but these errors were encountered: