Skip to content

Commit fa5e808

Browse files
authored
Merge pull request #843 from opencrvs/translations-in-csv
Translations as CSV files
2 parents 23d29b9 + 14f4cf1 commit fa5e808

23 files changed

+2358
-7081
lines changed

.github/workflows/validate-translation.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- Provisioning: Creates backup user on backup servers automatically
1111
- Provisioning: Update ansible Github action task version
1212

13+
- Copy: All application copy is now located in src/translations as CSV files. This is so that copy would be easily editable in software like Excel and Google Sheets. After this change, `AVAILABLE_LANGUAGES_SELECT` doesn't need to be defined anymore by country config.
14+
1315
## [1.4.0](https://github.com/opencrvs/opencrvs-farajaland/compare/v1.3.3...v1.4.0)
1416

1517
- Added examples for configuring HTTP-01, DNS-01, and manual HTTPS certificates. By default, development and QA environments use HTTP-01, while others use DNS-01.

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
"restore-snapshot": "bash infrastructure/backups/restore-snapshot.sh",
2828
"snapshot": "bash infrastructure/backups/backup.sh",
2929
"port-forward": "bash infrastructure/port-forward.sh",
30-
"validate-translations": "ts-node src/validate-translations.ts",
3130
"environment:init": "ts-node infrastructure/environments/setup-environment.ts",
32-
"sort-translations": "ts-node src/sort-translations.ts"
31+
"sort-translations": "ts-node -r tsconfig-paths/register src/sort-translations.ts"
3332
},
3433
"devDependencies": {
3534
"@graphql-codegen/add": "^3.1.1",
@@ -59,7 +58,6 @@
5958
"inquirer": "^9.2.12",
6059
"jest": "^26.6.0",
6160
"jest-fetch-mock": "^3.0.3",
62-
"json2csv": "^4.3.0",
6361
"jsonwebtoken": "^9.0.0",
6462
"kleur": "^4.1.5",
6563
"libsodium-wrappers": "^0.7.13",
@@ -86,7 +84,6 @@
8684
"@types/hapi__boom": "^9.0.1",
8785
"@types/hapi__hapi": "^20.0.0",
8886
"@types/jest": "^24.0.13",
89-
"@types/json2csv": "^4.2.0",
9087
"@types/jwt-decode": "^2.2.1",
9188
"@types/lodash": "^4.14.117",
9289
"@types/mime-types": "^2.1.0",
@@ -101,7 +98,8 @@
10198
"chalk": "^2.4.1",
10299
"country-data": "^0.0.31",
103100
"cross-env": "^6.0.3",
104-
"csv2json": "^1.4.2",
101+
"csv-stringify": "^6.4.6",
102+
"csv2json": "^2.0.2",
105103
"cypress": "9.6.1",
106104
"date-fns": "^2.28.0",
107105
"dotenv": "^6.1.0",
@@ -140,9 +138,8 @@
140138
"prettier --write",
141139
"git add"
142140
],
143-
"src/api/content/**/!(descriptions)*.json": [
141+
"src/translations/*.csv": [
144142
"yarn sort-translations",
145-
"prettier --write",
146143
"git add"
147144
]
148145
},

src/api/content/client/client.json

Lines changed: 0 additions & 4244 deletions
This file was deleted.

src/api/content/client/descriptions.json

Lines changed: 0 additions & 2114 deletions
This file was deleted.

src/api/content/handler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ interface IDefinitionsResponse {
4040
}
4141

4242
export async function contentHandler(
43-
request: Hapi.Request,
44-
h: Hapi.ResponseToolkit
43+
request: Hapi.Request
4544
): Promise<IDefinitionsResponse> {
4645
const application = request.params.application
4746
return {
48-
languages: (await getLanguages(application)).data
47+
languages: await getLanguages(application)
4948
}
5049
}

src/api/content/login/descriptions.json

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)