Add the `i18n-tasks-use` comments where the unrecognized translations are used (such as the date and activerecord ones). This way your unused list will correspond to the keys that are not actually used, and you can keep your files clean by using the `remove-unused` task.
Using `activerecord` translations is coupling your ActiveRecord layer to your UI, which is the wrong level of abstraction. They will cause issues when refactoring. I recommend avoiding these entirely.
I'd also suggest mentioning reference keys. These are invaluable in engines and larger apps. E.g.:
I have missing routes went i added the scope tomy route.rb files
Here is by file
scope "(:local)",locale: /#{I18n.available_locales.join("|")}/ do
resources :listings, except: [:edit] do
member do
get 'listing'
get 'description'
get 'photo_upload'
get 'price'
get 'address'
end
resources :photos, only:[:create,:destroy]
end
root to: "home#index"
devise_for :users, controllers: { registrations: 'registrations' }
resources :users ,only:[:show] do
resources :reports, only:[:new, :create]
end
end
Now i have missing routes errors but it works without the scope
What's the best way to get the language of a persons browser and set it as the default locale? You had it as a comment in your video at 3 mins and 30 seconds.
```
# request.env[“HTTP_ACCEPT_LANGUAGE”]
```
Thank you, Brian
warning: parser/current is loading parser/ruby26, which recognizes warning: 2.6.5-compliant syntax, but you are running 2.6.3. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
You could add this to your Gemfile to see if it helps. Alternatively, you could upgrade Ruby version to 2.6.5. There shouldn't be much breaking changes between 2.6.3 and 2.6.5.
This way your unused list will correspond to the keys that are not actually used, and you can keep your files clean by using the `remove-unused` task.
I recommend avoiding these entirely.
Thanks for the comments and your i18n-tasks gem!
great episode
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.5-compliant syntax, but you are running 2.6.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
How could I get around this parser issues ?