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
When setting locales dir array using I18n.listen method, using relative paths leads to an error
How to reproduce
set I18nJS.listen( locales_dir: ["config/locales"] + Dir.glob("vendor/**/config/locales"), )
in config/initializers/i18n.rb
What do you expect
Listen should watch for all changes in those folders
What happened instead
Server won't start with error:
/Users/francesco/.rbenv/versions/3.1.2/lib/ruby/3.1.0/pathname.rb:528:in relative_path_from': different prefix: "" and "/Users/francesco/projects/<app_name>" (ArgumentError)`
Description
When setting locales dir array using I18n.listen method, using relative paths leads to an error
How to reproduce
set
I18nJS.listen( locales_dir: ["config/locales"] + Dir.glob("vendor/**/config/locales"), )
in config/initializers/i18n.rb
What do you expect
Listen should watch for all changes in those folders
What happened instead
Server won't start with error:
/Users/francesco/.rbenv/versions/3.1.2/lib/ruby/3.1.0/pathname.rb:528:in
relative_path_from': different prefix: "" and "/Users/francesco/projects/<app_name>" (ArgumentError)`current working fix:
use
locales_dir: ["#{Rails.root}/config/locales"] + Dir.glob("#{Rails.root}/vendor/**/config/locales"),
Software:
Full backtrace
The text was updated successfully, but these errors were encountered: