Skip to content

Commit

Permalink
Merge pull request #6 from hotosm/add-patches
Browse files Browse the repository at this point in the history
patch United States to United States of America
  • Loading branch information
willemarcel authored Jul 24, 2020
2 parents 62bc124 + 2d4cdc0 commit 7fb749f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
- package-ecosystem: 'npm'
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
2 changes: 1 addition & 1 deletion lib/iso-countries-languages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hotosm/iso-countries-languages",
"version": "1.0.0",
"version": "1.0.1",
"description": "ISO 639-1 languages and ISO 3166-1 countries translated in the languages required by Tasking Manager",
"main": "./lib/iso-countries-languages.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion res/countries/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"UA": "Ukraine",
"AE": "United Arab Emirates",
"GB": "United Kingdom",
"US": "United States",
"US": "United States of America",
"UY": "Uruguay",
"UZ": "Uzbekistan",
"VU": "Vanuatu",
Expand Down
3 changes: 3 additions & 0 deletions scripts/patches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"en": [{ "key": "US", "value": "United States of America" }]
}
4 changes: 4 additions & 0 deletions scripts/updateResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs';

import supportedLangs from '../src/supportedLangs';
import countriesGeojson from '../res/countries';
import patches from './patches';
import { getCountryName, getCountryCode } from './utils';

const countries = countriesGeojson.elements
Expand All @@ -11,6 +12,9 @@ const countries = countriesGeojson.elements
for (const lang of supportedLangs) {
const data = {};
countries.forEach((country) => (data[getCountryCode(country)] = getCountryName(country, lang)));
if (patches[lang]) {
patches[lang].forEach((entry) => (data[entry.key] = entry.value));
}
fs.writeFileSync(`./res/countries/${lang}.json`, JSON.stringify(data));
}
console.log('Finished!');
2 changes: 1 addition & 1 deletion src/packagedJson.json.icl

Large diffs are not rendered by default.

0 comments on commit 7fb749f

Please sign in to comment.