diff --git a/README.md b/README.md index 4355d9b5..04e19fc2 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ Because meanTorrent autoload the movie info from [TMDB](https://www.themoviedb.o {name: 'zh', index: 1, class: 'flag-icon-cn', title: '中文'} ], ``` -Multilingual support, if you add a new translate string file, please add configuration here. The `name` if value of [ISO_639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), +Multilingual support, if you add a new translate string file, please add configuration here. The `name` is value of [ISO_639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), The class is used origin [flag-icon-css](https://github.com/lipis/flag-icon-css), you can find flag icon at `/public/lib/flag-icon-css/flags`. ```javascript @@ -352,8 +352,23 @@ meanTorrent used module `nodemailer`, if you have any config question you can fi } }, ``` -#### How to add translated language +## How to add translated language +1. Copy a translate string original file from `modules/core/client/app/trans-string-en.js` to your want named file, such as 'trans-string-fr.js', and then translate all the strings. +2. Add new language configure item in `config/env/torrent.js`. +```javascript + language: [ + {name: 'en', index: 0, class: 'flag-icon-gb', title: 'English'}, + {name: 'zh', index: 1, class: 'flag-icon-cn', title: '中文'}, + {name: 'fr', index: 2, class: 'flag-icon-fr', title: 'Français'} // this is added new language configure + ], +``` +Note: the `name` is value of [ISO_639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), +The class is used origin [flag-icon-css](https://github.com/lipis/flag-icon-css), +you can find flag icon at `/public/lib/flag-icon-css/flags`. +3. Of course, you can also delete unnecessary translate configure language item. +4. Copy and translate all the .md files in `modules/*/client/templates/*.md`, notice the naming rules of files please. +5. Restart meanTorrent. ## Deploying to PAAS diff --git a/config/assets/default.js b/config/assets/default.js index 41789e3a..fe5c829e 100644 --- a/config/assets/default.js +++ b/config/assets/default.js @@ -90,10 +90,7 @@ module.exports = { 'modules/*/client/scss/*.scss' ], js: [ - 'modules/core/client/app/config.js', - 'modules/core/client/app/init.js', - 'modules/core/client/app/trans-string-cn.js', - 'modules/core/client/app/trans-string-en.js', + 'modules/core/client/app/*.js', 'modules/*/client/*.js', 'modules/*/client/**/*.js' ],