File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
addon/instance-initializers Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -4,26 +4,24 @@ Automatically expose translations for addon in a way that can be merged in with
4
4
*/
5
5
import Ember from 'ember' ;
6
6
import en from 'ember-osf/locales/en/translations' ;
7
- import tHelper from 'ember-i18n/helper' ;
8
-
9
7
10
8
export function initialize ( appInstance ) {
11
- tHelper . reopen ( {
9
+ const i18n = appInstance . lookup ( 'service:i18n' ) ;
10
+ i18n . reopen ( {
12
11
theme : Ember . inject . service ( ) ,
13
- compute ( _ , params ) {
14
- let translations = this . get ( 'i18n. _locale.translations' ) ;
12
+ t ( _ , data ) {
13
+ let translations = this . get ( '_locale.translations' ) ;
15
14
let preprintWord = this . get ( 'theme.provider.preprintWord' ) || 'preprint' ;
16
- params = params || { } ;
17
- params . preprintWords = {
15
+ data = data || { } ;
16
+ data . preprintWords = {
18
17
preprint : translations [ `preprintWords.${ preprintWord } .preprint` ] ,
19
18
preprints : translations [ `preprintWords.${ preprintWord } .preprints` ] ,
20
19
Preprint : translations [ `preprintWords.${ preprintWord } .Preprint` ] ,
21
20
Preprints : translations [ `preprintWords.${ preprintWord } .Preprints` ]
22
21
} ;
23
- return this . _super ( _ , params ) ;
22
+ return this . _super ( _ , data ) ;
24
23
}
25
24
} ) ;
26
- const i18n = appInstance . lookup ( 'service:i18n' ) ;
27
25
i18n . addTranslations ( 'en' , en ) ;
28
26
}
29
27
You can’t perform that action at this time.
0 commit comments