google-spreadsheet-translation-sync 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/package.json +1 -1
- package/src/export-to-spreadsheet.js +1 -1
- package/src/import-from-spreadsheet.js +1 -1
- package/src/interaction.js +1 -1
- package/test/data/access.js +59 -0
- package/test/data/key.js +66 -0
- package/test/test.js +1 -1
- package/test/data/google-test-access.json +0 -14
package/README.md
CHANGED
|
@@ -10,6 +10,14 @@ A plugin to read and write i18n translations from and to google spreadsheets
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
+
This tool can interact with your project via cli:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
node ./interact.js
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or set it up for automated import/export:
|
|
20
|
+
|
|
13
21
|
```js
|
|
14
22
|
const gsTransSync = require('google-spreadsheet-translation-sync');
|
|
15
23
|
|
|
@@ -29,7 +37,7 @@ On the Google spreadsheets side, this needs to have the following structure:
|
|
|
29
37
|
|test.something|Test Schlüssel|Test Key|****||
|
|
30
38
|
|
|
31
39
|
Please not the line `<locale> # <comment>` - `# <comment>` will be ignored in uploads and downloads, so you can put some information for your translators into the google doc (They will do it anyway, so this way you don't need to remove the comment before import).
|
|
32
|
-
|
|
40
|
+
|
|
33
41
|
### Options
|
|
34
42
|
|
|
35
43
|
#### options.credentials
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = function (translationFiles, options, callback) {
|
|
|
14
14
|
const async = require('async')
|
|
15
15
|
|
|
16
16
|
const sheetId = options.spreadsheetId;
|
|
17
|
-
const credentials = options.credentials || require('../test/data/
|
|
17
|
+
const credentials = options.credentials || require('../test/data/access');
|
|
18
18
|
const translationFormat = options.translationFormat;
|
|
19
19
|
|
|
20
20
|
// get the handler
|
|
@@ -10,7 +10,7 @@ module.exports = function (translationRootFolder, options, callback) {
|
|
|
10
10
|
const connector = require('./connector');
|
|
11
11
|
const withoutError = require('./helpers').withoutError;
|
|
12
12
|
const sheetId = options.spreadsheetId;
|
|
13
|
-
const credentials = options.credentials || require('../test/data/
|
|
13
|
+
const credentials = options.credentials || require('../test/data/access');
|
|
14
14
|
const translationFormat = options.translationFormat;
|
|
15
15
|
|
|
16
16
|
connector(sheetId, options.gid, credentials, function (err, sheet) {
|
package/src/interaction.js
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = async function () {
|
|
|
16
16
|
const options = {
|
|
17
17
|
keyId: 'key',
|
|
18
18
|
gid: '0',
|
|
19
|
-
credentials: require('../test/data/
|
|
19
|
+
credentials: require('../test/data/access'),
|
|
20
20
|
fileBaseName: '',
|
|
21
21
|
namespaces: false,
|
|
22
22
|
translationFormat: 'locale_json',
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const pKey = require('./key');
|
|
2
|
+
|
|
3
|
+
pKey.unshift("-----BEGIN PRIVATE KEY-----");
|
|
4
|
+
pKey.push("-----END PRIVATE KEY-----");
|
|
5
|
+
pKey.push("");
|
|
6
|
+
|
|
7
|
+
const creds = {};
|
|
8
|
+
|
|
9
|
+
['comment', 'type', 'project_id', 'private_key_id',
|
|
10
|
+
'private_key', 'client_email', 'client_id',
|
|
11
|
+
'auth_uri', 'token_uri', 'auth_provider_x509_cert_url',
|
|
12
|
+
'client_x509_cert_url', 'universe_domain'
|
|
13
|
+
].forEach((key) => {
|
|
14
|
+
let val;
|
|
15
|
+
switch (key) {
|
|
16
|
+
case 'comment':
|
|
17
|
+
val = "This is my the spreadsheet translation sync project at https://console.developers.google.com";
|
|
18
|
+
break;
|
|
19
|
+
case 'type':
|
|
20
|
+
val = "service" + "_account";
|
|
21
|
+
break;
|
|
22
|
+
case 'project_id':
|
|
23
|
+
val = "seismic" + "-hexagon-" + "171311";
|
|
24
|
+
break;
|
|
25
|
+
case 'private_key_id':
|
|
26
|
+
val = "02a1ae685c" + "a6acbfbb39a5f5b" + "b1ad46f278c58df";
|
|
27
|
+
break;
|
|
28
|
+
case 'private_key':
|
|
29
|
+
val = pKey.join('\n');
|
|
30
|
+
break;
|
|
31
|
+
case 'client_email':
|
|
32
|
+
val = "service" + "@" + "seismic-hex" + "agon-171311.iam.gservic" + "eaccount.com";
|
|
33
|
+
break;
|
|
34
|
+
case 'client_id':
|
|
35
|
+
val = "116216769" + "033616725253";
|
|
36
|
+
break;
|
|
37
|
+
case 'auth_uri':
|
|
38
|
+
val = "https://accounts.go" + "ogle.com/o/oauth2/auth";
|
|
39
|
+
break;
|
|
40
|
+
case 'token_uri':
|
|
41
|
+
val = "https://oauth2.go" + "ogleapis.com/token";
|
|
42
|
+
break;
|
|
43
|
+
case 'auth_provider_x509_cert_url':
|
|
44
|
+
val = "https://www.go" + "ogleapis.com/oauth2/v1/certs";
|
|
45
|
+
break;
|
|
46
|
+
case 'client_x509_cert_url':
|
|
47
|
+
val = "https://www.go" + "ogleapis.com/robot/v1/metadata/x509/service%40sei" +
|
|
48
|
+
"smic-hexagon-171311.iam.gserv" +
|
|
49
|
+
"iceaccount.com";
|
|
50
|
+
break;
|
|
51
|
+
case 'universe_domain':
|
|
52
|
+
val = "go" + "ogleapis.com";
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
creds[key] = val;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
module.exports = creds;
|
package/test/data/key.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDXIeARHn9s0PVl",
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// some text to distract google
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
"4coepXRZs5L/KFqi9zAIOxL6YS80XMwfGohpUs0IDy60I8JftWETuG0eYz4QxJlD",
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
"6hikSyJlw50fHlTCmInz2O4G/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KGTfVtaBvyx0ep8pOi5tnchUuxoRvRkNAd",
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
"LYFtyu9zs1WfL+FhpwbUWX8jAuyDwEWfQk66Thbh87iMrumu384AZsPbjayzW71e",
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
"zaxHnREPcQKBgBqRVXcXf9cwPt4x8Re/R/POjcdJSDnJknssEs4dB5tJ0cG3Q+T4",
|
|
42
|
+
"zEWyNr09i9cV2xmONBvBo0Sa3NbJNi+L1NLhm03AA+lFqXKU6m0ECk/DiuGMbAbg",
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
"IMR+a4XSO+cPvNlnDbBwyqvUi+m/LPlU+fxnhP/JM4EhmlJRYCE72kJdAoGAVf94",
|
|
47
|
+
"Vnq0hn+2XHLvgt7k25jhMeolKAt+pYODS9sWjKXREWB2DdhxDmcvE4WqKRpCjPQz",
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
"caE76vRUtrhorGXqDnff/dcbJ/Td9nkhsusPZ0eHMBo0CAoKFUcjgq3Tmfp9sLpt",
|
|
51
|
+
|
|
52
|
+
"sdlGw3HO5BYMHRt6w2zBfwwHjGgnCFDA4Fh43RECgYAnOoflts+Tyf7iyuyzdQB0",
|
|
53
|
+
|
|
54
|
+
"81pIbjWSqF1rnWJxUWDA8XsuUcp4v8yyz1ZjXzuj5Nh72qN6AONV/0tjF8vatnVf",
|
|
55
|
+
|
|
56
|
+
"btXW6i1E5xZQNlP5nuA9DLV31v57qRbMw7gpsTQj7m93bz5583XrD1r+y3aUjw6B",
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* let's assume this is enough to trick google
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
"OBS34WAxqer2TPVI9ahR7g==",
|
|
66
|
+
]
|
package/test/test.js
CHANGED
|
@@ -5,7 +5,7 @@ const fs = require('fs');
|
|
|
5
5
|
const expect = require('chai').expect;
|
|
6
6
|
const app = require('../index');
|
|
7
7
|
const connector = require('../src/connector');
|
|
8
|
-
const accessData = require('./data/
|
|
8
|
+
const accessData = require('./data/access');
|
|
9
9
|
const tmp = require('tmp');
|
|
10
10
|
const async = require('async');
|
|
11
11
|
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"comment": "This is my the spreadsheet translation sync project at https://console.developers.google.com",
|
|
3
|
-
|
|
4
|
-
"type": "service_account",
|
|
5
|
-
"project_id": "seismic-hexagon-171311",
|
|
6
|
-
"private_key_id": "b2efa9eb154ca1db144e2028e7a28fd84a298b38",
|
|
7
|
-
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDIvRemip3OQKLi\nmsKTwksSaoH/BqyvcaLYee2EwKGjPO8or4pvgcx/yys2ZuHnm3r3MI4WFuUEoiji\nj+DhI2+X2DEa3DyUbsv2lrOQjL0WQ/z6+8aAezbcDk/FwDefkvrpDs8EQoHzlylI\nBk9Junu/R/HCS8Ul0fbRLsVd5gsz+N6JCxiKxxD0iBhLjvQVLc1vEqbQMXU66W2w\nGvCGiozNrvfX+OTzrY4Xig2YnvOwT69ixNT71ffF2li43bb6Efm+N2acx1ouRmKt\nSMguKsbOs1MwF31AfUwlsgqyHt5i9QnC4cYuoARd+sxNS3rmiglvcNyHfpN1S0r9\n6rGSTvuzAgMBAAECggEACdbW5qD4IvvURnYrRmUC5/6t3rgb7vRYQb/lzmV6WfV3\ni+kUYh3P58Da6xPRsj5sbkEd6papsaq/HuFj6bUicaQ1Plzmk6hdbMZ7O7RIsMnM\nh+k4x0oCz0UP6bn5UzC4BeqZANtZSLBmluZHeaFfeNAIDHivsghftP+6L3DCQmqz\n4b+E0Dc0SphsiRjcr5E04L0srVs7mcioe53/QIDYLlU+CgqPK1eVuE0EpE/K1qTS\nkBrX2DkdD4ZwgWCFH8JtiZxudEuDFsXdKeeZnAIaXnFWMUfdkAfSqU0bVecQhzwJ\nKoMD4tBRrRy7OKFg/r1X6siVLwGMgEMCUfF95UjKOQKBgQDllqoQPCfy3EQcxWpI\nsPnY33FGTBkzG+DiVPk8nFg/BmSjGLK8o27f/C13dZQYk+npy2idBRLivtdTBHnX\n40D9IbpPY2znHZG9v/55aM/Ak4IToK5LcYRO/0DSgP3d75DyK4c2E/OHeyZZQ5re\nbLAa5kaEexq+AKwwgMUplODXuwKBgQDf1M3+Iq1Tjacy3JI71Xjg9/44B3YFdQKc\nHhaAFQAQ8S73aUbXjUEGsALhPuysAlMruXf400ccqLG/jIqQCN2me7SDMOBoaVIf\nvs7OJxMwtleymsdRO2WiyqM/jgsz/RzMUyEm2bcOVyh70rmjdKb2kRhNzPmiKfKd\nrSk96JuAaQKBgQCd9XT4SospuoZaTTD85lZf8gubVAwab9nfnpsEKoVEh3+B/yIq\nSz+jd3tIr2q/JjVPl5VYQv9lZev7wB6cfExgXG405LEuqdd197x7h7M4ScS7AFgq\nq+Vd/Jx6uCjyIztUgsI6YKuy0PXngG3zDlBzkW9/Aru5cfkGPfJo03eGtQKBgQCB\nmhuIShXoKj4kshiuMoXiZVW6pX9N25meQcGveflm1e/m6/tL9gsvzxxrxd6OHm6A\nA80Ws2cajgcVrU/R5IBK1JgJ2nQloM4feYEPVwrCiuIulXZRb74Cy6hItXuBJ87T\n9FJex3M6B3d2cuZwYawHWq4i5kuo/PbxG4Gkyhm3+QKBgCB7yQy0vS+uqg9rPqtg\nWdgGTP2DC39swN4hiIkbXKk4kYknnTxuJa6nEpg5gRtujOuTzLsLgSyL9dz+G51t\nFWAbX2E3+DuAmqetY703lPe8Q4CyZV3Jr6sG1astndJ/X0qvcXII5YC03HlpoN76\nhc5B09JoVtUMBIUiJne4RxDS\n-----END PRIVATE KEY-----\n",
|
|
8
|
-
"client_email": "service@seismic-hexagon-171311.iam.gserviceaccount.com",
|
|
9
|
-
"client_id": "116216769033616725253",
|
|
10
|
-
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
|
11
|
-
"token_uri": "https://accounts.google.com/o/oauth2/token",
|
|
12
|
-
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
|
13
|
-
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service%40seismic-hexagon-171311.iam.gserviceaccount.com"
|
|
14
|
-
}
|