Episodes
glebm said over 5 years ago on Working with Internationalization :
  1. 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.
  2. 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.
  3.  I'd also suggest mentioning reference keys. These are invaluable in engines and larger apps. E.g.:
    en:
      greetings: Hello guest!
      visitors:
        index:
          greetings: :greetings
  4. You can use `translate-missing` instead of `add-missing` to add Google-Translated values Japanese version.
  5. Another useful task is `i18n-tasks mv` for renaming keys.

David Kimura PRO said over 5 years ago on Working with Internationalization :

Thanks for the comments and your i18n-tasks gem!


Rocela Durazo said over 5 years ago on Working with Internationalization :

great episode


foliwe said about 5 years ago on Working with Internationalization :
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

brian PRO said almost 3 years ago on Working with Internationalization :
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

David Ng PRO said over 2 years ago on Working with Internationalization :
When I use i18n-tasks normalize, I got message

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 ?


David Kimura PRO said over 2 years ago on Working with Internationalization :
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.

gem 'parser'

David Ng PRO said over 2 years ago on Working with Internationalization :
It does not help.  problem persist.

David Kimura PRO said over 2 years ago on Working with Internationalization :
I remember getting this error a few years back and ended up changing my ruby version.

David Ng PRO said over 2 years ago on Working with Internationalization :
I see what I can do.  Thx for sharing.


Login to Comment