Skip to content

Commit c4e17a5

Browse files
committed
feat: add script to generate translation schema
1 parent 9c1556e commit c4e17a5

File tree

5 files changed

+1217
-2
lines changed

5 files changed

+1217
-2
lines changed

api/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"db:up": "yarn migrate latest",
1515
"test": "vitest --watch=false --no-file-parallelism",
1616
"dev": "yarn build && yarn start",
17+
"generate-translation-schema": "node scripts/generate-translation-schema.js",
1718
"build": "tsc && cp -r src/customization dist/src/",
1819
"start": "yarn db:up && dotenv -e ../.env -- node dist/src/entrypoints/start-api.js",
1920
"update": "dotenv -e ../.env -- node dist/src/entrypoints/update.js",
@@ -74,6 +75,7 @@
7475
"@octokit/graphql": "^7.0.2",
7576
"@trpc/server": "^10.18.0",
7677
"@types/pg": "^8.11.6",
78+
"generate-schema": "^2.6.0",
7779
"jsdom": "^26.0.0",
7880
"jwt-decode": "^3.1.2",
7981
"kysely": "^0.27.4",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const GenerateSchema = require("generate-schema");
2+
const fs = require("fs");
3+
4+
const schema = GenerateSchema.json("Catalogi translations schema", require("../src/customization/translations/en.json"));
5+
6+
fs.writeFileSync("./src/customization/translations/schema.json", JSON.stringify(schema, null, 2));

api/src/customization/translations/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2+
"$schema": "https://github.com/codegouvfr/sill/blob/move-transalations-to-backend/api/src/customization/translations/schema.json",
23
"common": {
34
"user_one": "utilisateur",
45
"user_other": "utilisateurs",
5-
"referent_one": "référent",
66
"referent_other": "référents",
77
"provider_one": "fournisseur",
88
"providers_other": "fournisseurs",

0 commit comments

Comments
 (0)