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:inrelative_path_from': different prefix: "" and "/Users/francesco/projects/" (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/current working fix:
use
locales_dir: ["#{Rails.root}/config/locales"] + Dir.glob("#{Rails.root}/vendor/**/config/locales"),
Software:
Full backtrace