Files: 8c68dbb9a3b69a0cf0e0dd503ef059a873189cd5 / translations / sync.js
453 bytesRaw
1 | const nest = require('depnest') |
2 | const merge = require('lodash/merge') |
3 | |
4 | exports.gives = nest('translations.sync.strings') |
5 | |
6 | exports.needs = nest('settings.sync.get', 'first') |
7 | |
8 | const languages = { |
9 | en: require('./en.js'), |
10 | zh: require('./zh.js') |
11 | } |
12 | |
13 | exports.create = (api) => { |
14 | return nest('translations.sync.strings', () => { |
15 | const language = api.settings.sync.get('language', 'en') |
16 | |
17 | return merge({}, languages.en, languages[language]) |
18 | }) |
19 | } |
20 | |
21 |
Built with git-ssb-web