Commit f08ec6a5 authored by Matija Obreza's avatar Matija Obreza
Browse files

i18n: add translations.json mapping

parent 9d0364e1
......@@ -73,6 +73,10 @@ const generateHashedLocales = () => {
fs.writeFileSync(`${rootDir}/${newFilePath}`, fileContent, { flag: 'wx' });
localeHashMapping[mappingPath] = newFilePath.replace('./generated', ''); // deleting '/generated' from new path for further loading
// console.log(`Generated ${ newFilePath } for ${ path }`);
if (mappingPath.endsWith(`/${process.env.moduleName}.json`)) {
console.log(`Registering 'translations.json' mapping for ${mappingPath}`);
localeHashMapping[mappingPath.replace(`/${process.env.moduleName}.json`, '/translations.json')] = localeHashMapping[mappingPath];
}
});
console.log('Locale mappings', localeHashMapping);
fs.writeFileSync(`${rootDir}/generated/locales/localesMapping.json`, JSON.stringify(localeHashMapping), { encoding: 'utf8' }); // after all locales moved creating file with mappings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment