File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,15 @@ const walk = require('walk');
3232const parser = require ( "@babel/parser" ) ;
3333const traverse = require ( "@babel/traverse" ) ;
3434
35- const TRANSLATIONS_FUNCS = [ '_t' , '_td' ] ;
35+ // Find the package.json for the project we're running gen-18n against
36+ const projectPackageJsonPath = path . join ( process . cwd ( ) , 'package.json' ) ;
37+ const projectPackageJson = require ( projectPackageJsonPath ) ;
38+
39+ const TRANSLATIONS_FUNCS = [ '_t' , '_td' ]
40+ // Add some addition translation functions to look out that are specified
41+ // per project in package.json under the
42+ // "matrix_i18n_extra_translation_funcs" key
43+ . concat ( projectPackageJson . matrix_i18n_extra_translation_funcs || [ ] ) ;
3644
3745const INPUT_TRANSLATIONS_FILE = 'src/i18n/strings/en_EN.json' ;
3846const OUTPUT_FILE = 'src/i18n/strings/en_EN.json' ;
You can’t perform that action at this time.
0 commit comments