Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion scripts/gen-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ const walk = require('walk');
const parser = require("@babel/parser");
const traverse = require("@babel/traverse");

const TRANSLATIONS_FUNCS = ['_t', '_td'];
// Find the package.json for the project we're running gen-18n against
const projectPackageJsonPath = path.join(process.cwd(), 'package.json');
const projectPackageJson = require(projectPackageJsonPath);

const TRANSLATIONS_FUNCS = ['_t', '_td']
// Add some addition translation functions to look out that are specified
// per project in package.json under the
// "matrix_i18n_extra_translation_funcs" key
.concat(projectPackageJson.matrix_i18n_extra_translation_funcs || []);

const INPUT_TRANSLATIONS_FILE = 'src/i18n/strings/en_EN.json';
const OUTPUT_FILE = 'src/i18n/strings/en_EN.json';
Expand Down