INNER CODE UNIT · JavaScript

writeLocaleMetadata

GDevelopApp/GDevelop-extensions · scripts/compile-translations.js:83

const writeLocaleMetadata = (object) => {
  const content = [
    `// This file is generated by compile-translations.js script`,
    `// prettier-ignore`,
    `module.exports = ${JSON.stringify(object, null, 2)};`,
    ``,
  ].join('\n');
  fs.writeFileSync(getLocaleMetadataPath(), content);
};

/**
 *
 * @param {string} path
 * @returns {Promise<{forbiddenStringsFound: {str: string, regex: RegExp}[]}>}
 */
const sanitizeMessagePo = (path) => {
  return readUtf8File(path).then((content) => {
    /** @type {{str: string, regex: RegExp}[]} */

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…