Translations in CloudCode
Step 1: Add the js-yaml library
yarn add js-yamlStep 2: Read the file
const fs = require('fs');
const yaml = require('js-yaml');
export async function run() {
const language = 'en_US';
const doc = yaml.safeLoad(fs.readFileSync(`app/translations/${language}.yml`, 'utf8'));
console.log(doc);
}Further reading:
TranslationsLast updated