Ember-Cli-Admin-Languages
Plugin for ember-cli-admin that adds multiple languages properties support
Installation
First, run in your ember-cli-admin
project directory:
npm install ember-cli-admin-languages --save-dev
Then
ember g ember-cli-admin-languages
And finally add this lines to your Brocfile.js
var pickFiles = ;var mergeTrees = ; var icons = ; moduleexports = ;
Usage
The main thing to start using this plugin is to define your locales list somewhere. For example, it can be defined just in your controller, or globally in config/evironment.js
, that is more convenient.
Locales is just array, that should be defined like this:
//config/evironment.js... locales: 'en' 'ru' 'de' 'fr'...
Next, you should check your model. Properties you want to be multilanguage must be defined with suffix _{{locale name}}
.
For example, for property name
and locales ['en', 'ru', 'de', 'fr']
:
... name_en: DS name_de: DS name_fr: DS name_ru: DS...
The component itself can be used like this:
{{translate-tabs attribute="name" model=model locales=locales}}
You can define input type for each tab. Available types:
- input (default)
- textarea (you should set
isTextArea=true
) - wysihtml5 editor (you should set
isTextArea=true
andwithEditor=true
)
Also, if you want to change this component someway, you should import it and just extend (for example, you want define locale to every instance):
//app/components/translate-tabs.js ;; ;
Contribution
You can see contribution guide at ember-cli-admin
project's contributing guide.
License
[Licensed under MIT license] 1