1.1.1 • Published 11 months ago
i18n-tools-testing-effectiva v1.1.1
Instructions
In design project(beu, cross):
- npm i i18n-tools-testing-effectiva
- at root, add a mjs file (eg. export-translations.mjs) with the following content:
import { join, dirname } from "path";
import exportT from "i18n-tools/t-to-yml.mjs";
import { fileURLToPath } from "url";
let fileName = process.argv[2];
if (!fileName) throw new Error("Missing argument: the name of the yml file!");
if (!fileName.endsWith(".yml")) fileName += ".yml";
const __dirname = dirname(fileURLToPath(import.meta.url));
const beunityFolder = {
path: join(__dirname, "..", "components"),
prefix: "bu",
subtitle: "beunity_components",
};
const effectivaFolder = {
// path to node_modules installation of lit components
path: join(
__dirname,
"..",
"node_modules",
"@effectivastudio",
"lit-components",
"components"
),
prefix: "ef",
subtitle: "web_components",
};
exportT([effectivaFolder, beunityFolder], join(process.cwd(), fileName));
- add npm script: "export-translations": "node ./export_translations.mjs"
in parent project (ruby project)
- install design package
- add npm script: "export-design-translations": "npm run export-translations --prefix {{path to design project}}"
- npm run export-translations {{desired_yml_file_path}}