forked from openstreetmap/iD
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpd_locales.js
More file actions
25 lines (22 loc) · 918 Bytes
/
pd_locales.js
File metadata and controls
25 lines (22 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require('fs');
const dir = './dist/locales';
fs.readdir(dir, (err, files) => {
if (err) throw err;
files.forEach(file => {
const path = dir + '/' + file;
fs.readFile(path, (err, data) => {
if (err) throw err;
var out = new String(data)
.replace(/\(https:\/\/github.com\/openstreetmap\/iD\)/g, '(https://github.com/osm-sandbox/sandbox-iD)')
.replace(/OpenStreetMap/g, 'OSM Sandbox')
.replace(/https:\/\/www.openstreetmap.org\/copyright/g, 'https://www.publicdomainmap.org/license')
.replace(/\(https:\/\/www.openstreetmap.org\/\)/g, '(https://www.publicdomainmap.org/)')
// FIXME - these two aren't multi-language
.replace(/on openstreetmap.org/g, 'on osmsandbox.us')
.replace(/History on osm.org/g, 'History on osmsandbox.us');
fs.writeFile(path, out, (err) => {
if (err) throw err;
});
});
})
});