Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
CSS
I am trying localisation in js file using i18n-js gem.

in i18n-js.yml

translations:
  - file: "app/assets/javascripts/i18n/%{locale}.js"
    only: ['cust_details', 'order_details']
I am trying to load only 'cust_details' and 'order_details' into translation file and split them per locale (i.e) create separate js translation file for each language with translations only for 'cust_details' and 'order_details' while avoiding loading of other keys.

I tried the following too :

translations:
- file: "public/javascripts/i18n/%{locale}.js"
  only: ['*.cust_details', '*.order_details']

Both the above methods return syntax errors in 'only' line.

When I try to add a single content/namespace this works fine. ex:

translations:
  - file: "public/javascripts/i18n/%{locale}.js"
    only: "cust_details"

The above code works

Thanks.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900