Skip to content

Commit

Permalink
Add french transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Spl3en committed May 18, 2019
1 parent 4b38add commit c9449ff
Show file tree
Hide file tree
Showing 11 changed files with 553 additions and 289 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ Svalinn-win32-x64
Svalinn-win32-x64.*
yarn.lock
TODO

src/js/i18n/dictionary.json
package-lock.json
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function createWindow()
webPreferences: {
nativeWindowOpen: true,
nodeIntegrationInWorker: true,
nodeIntegration: true
},
};

Expand Down Expand Up @@ -299,4 +300,4 @@ function changeAppLanguage(selectedLang) {
//Sends a message from the main process to the renderer process with the language that the user selected
let lang = selectedLang.label;
win.webContents.send('change-lang', lang);
}
}
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "svalinn",
"productName": "Svalinn",
"description": "ICONation ICX Wallet",
"version": "0.1.6",
"version": "0.1.7",
"homepage": "https://github.com/ICONation/svalinn",
"repository": "https://github.com/ICONation/svalinn",
"main": "main.js",
"scripts": {
"start": "electron .",
"debug": "electron . debug",
"dev": "electron . dev",
"install": "node src/js/i18n/dictionaryService.js",
"postinstall": "install-app-deps",
"pack": "build --dir",
"dist": "build"
Expand All @@ -19,27 +20,30 @@
"license": "Apache-2.0",
"devDependencies": {
"devtron": "^1.4.0",
"electron": "^4.0.5",
"electron-builder": "^20.38.5",
"electron": "^5.0.1",
"electron-builder": "^20.41.0",
"electron-packager": "^13.1.1",
"electron-winstaller": "^3.0.4",
"jshint": "^2.10.1"
"jshint": "^2.10.2"
},
"dependencies": {
"@trodi/electron-splashscreen": "^0.3.4",
"ag-grid-community": "^19.1.4",
"ag-grid-community": "^20.2.0",
"async": "^2.6.2",
"csv-writer": "^1.2.0",
"electron-log": "^2.2.17",
"electron-store": "^2.0.0",
"clean": "^4.0.2",
"csv-writer": "^1.3.0",
"electron-log": "^3.0.5",
"electron-store": "^3.2.0",
"fnv-plus": "^1.2.12",
"icon-sdk-js": "0.0.10",
"icon-sdk-js": "0.0.16",
"node-crypto-gcm": "^1.0.3",
"qr-image": "^3.2.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"secp256k1": "^3.7.0",
"sessionstorage": "^0.1.0",
"shell": "^0.5.0",
"superagent": "^4.1.0"
"superagent": "^5.0.5"
},
"build": {
"appId": "org.iconation.svalinn",
Expand Down
2 changes: 1 addition & 1 deletion src/js/i18n/dictionary.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions src/js/i18n/dictionaryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ const langConfig = require("./lang-config.json");
const stringRel = require("./string-rel.json");
const englishJSON = require("./lang/english.json");
const spanishJSON = require("./lang/spanish.json");
const frenchJSON = require("./lang/french.json");
const langOrder = langConfig["order"];

// const filePath = "./lang/";

let _DICT_EXIST = false;

// Check if dictionary is already created
if (fs.existsSync("./dictionary.json")) {
if (fs.existsSync("./src/js/i18n/dictionary.json")) {
_DICT_EXIST = true;
}

// if the dictionary doesnt exists already
if (!_DICT_EXIST) {
let englishExpanded = expandLangJSON(englishJSON);
let spanishExpanded = expandLangJSON(spanishJSON);
let englishDict = createLangDict(stringRel, englishExpanded);
let spanishDict = createLangDict(stringRel, spanishExpanded);
let englishExpanded = expandLangJSON(englishJSON);
let spanishExpanded = expandLangJSON(spanishJSON);
let frenchExpanded = expandLangJSON(frenchJSON);
let englishDict = createLangDict(stringRel, englishExpanded);
let spanishDict = createLangDict(stringRel, spanishExpanded);
let frenchDict = createLangDict(stringRel, frenchExpanded);

// List with all the individual language dictionaries
// Modify this to add more languages to the dictionary
// the languages needs to be added in the order that appears
// in langOrder
let languageList = [englishDict, spanishDict];
// List with all the individual language dictionaries
// Modify this to add more languages to the dictionary
// the languages needs to be added in the order that appears
// in langOrder
let languageList = [englishDict, spanishDict, frenchDict];

// create language dictionary
let i18nDict = createDictionary(languageList);
// create language dictionary
let i18nDict = createDictionary(languageList);

// saving dictionary as a json file
fs.writeFile("dictionary.json", i18nDict, (err) => {
if (err) {console.log(err)};
console.log("dictionary saved to file");
//let langOrder = ["English", "Espa\u00F1ol"];
});
}
// saving dictionary as a json file
fs.writeFile("./src/js/i18n/dictionary.json", i18nDict, (err) => {
if (err) {console.log(err)};
console.log("dictionary saved to file");
//let langOrder = ["English", "Espa\u00F1ol"];
});

///////////////////////////////////////////////////////
// Function declarations
Expand Down
138 changes: 137 additions & 1 deletion src/js/i18n/lang-config.json
Original file line number Diff line number Diff line change
@@ -1 +1,137 @@
{"order":["English","Español"],"eng":{"name":"English","file":"src/js/i18n/lang/english.json"},"esp":{"name":"Español","file":"src/js/i18n/lang/spanish.json"},"keys":["welcome-text-1","welcome-text-2","welcome-text-3","welcome-text-4","welcome-text-5","about-text-1","about-text-2","about-text-3","about-text-4","address-add-text-1","address-add-text-2","address-add-text-3","address-add-text-4","address-add-text-5","address-add-text-6","address-add-text-7","address-book-text-1","address-book-text-2","address-book-text-3","address-book-text-4","address-book-text-5","address-book-text-6","address-book-text-7","address-book-text-8","create-text-1","create-text-2","create-text-3","create-text-4","create-text-5","create-text-6","create-text-7","create-text-8","create-text-9","create-text-10","create-text-11","create-text-12","create-text-13","create-text-14","create-text-15","create-text-16","create-text-17","create-text-18","index-text-1","index-text-2","index-text-2-1","index-text-3","index-text-4","index-text-5","index-text-6","index-text-7","index-text-8","index-text-9","index-text-10","index-text-11","index-text-12","overview-create-text-1","overview-create-text-2","overview-create-text-3","overview-create-text-4","overview-create-text-5","overview-create-text-6","overview-create-text-7","overview-text-1","overview-text-2","overview-text-3","overview-text-4","overview-text-5","overview-text-6","overview-text-7","overview-text-8","overview-text-9","overview-text-10","overview-import-text-1","overview-import-text-2","overview-import-text-3","overview-import-text-4","overview-import-text-5","overview-import-text-6","overview-import-text-7","overview-import-text-8","overview-import-text-9","overview-load-text-1","overview-load-text-2","overview-load-text-3","overview-load-text-4","overview-load-text-5","overview-show-text-1","overview-show-text-2","overview-show-text-3","overview-show-text-4","overview-show-text-5","overview-show-text-6","overview-show-text-7","overview-show-text-8","overview-show-text-9","send-text-1","send-text-2","send-text-3","send-text-4","send-text-5","send-text-6","send-text-7","shortcuts-text-1","shortcuts-text-2","shortcuts-text-3","shortcuts-text-4","shortcuts-text-5","shortcuts-text-6","shortcuts-text-7","shortcuts-text-8","shortcuts-text-9","shortcuts-text-10","shortcuts-text-11","shortcuts-text-12","shortcuts-text-13","shortcuts-text-14"]}
{
"order": [
"English",
"Español",
"French"
],
"eng": {
"name": "English",
"file": "src/js/i18n/lang/english.json"
},
"esp": {
"name": "Español",
"file": "src/js/i18n/lang/spanish.json"
},
"fr": {
"name": "French",
"file": "src/js/i18n/lang/french.json"
},
"keys": [
"welcome-text-1",
"welcome-text-2",
"welcome-text-3",
"welcome-text-4",
"welcome-text-5",
"about-text-1",
"about-text-2",
"about-text-3",
"about-text-4",
"address-add-text-1",
"address-add-text-2",
"address-add-text-3",
"address-add-text-4",
"address-add-text-5",
"address-add-text-6",
"address-add-text-7",
"address-book-text-1",
"address-book-text-2",
"address-book-text-3",
"address-book-text-4",
"address-book-text-5",
"address-book-text-6",
"address-book-text-7",
"address-book-text-8",
"create-text-1",
"create-text-2",
"create-text-3",
"create-text-4",
"create-text-5",
"create-text-6",
"create-text-7",
"create-text-8",
"create-text-9",
"create-text-10",
"create-text-11",
"create-text-12",
"create-text-13",
"create-text-14",
"create-text-15",
"create-text-16",
"create-text-17",
"create-text-18",
"index-text-1",
"index-text-2",
"index-text-2-1",
"index-text-3",
"index-text-4",
"index-text-5",
"index-text-6",
"index-text-7",
"index-text-8",
"index-text-9",
"index-text-10",
"index-text-11",
"index-text-12",
"overview-create-text-1",
"overview-create-text-2",
"overview-create-text-3",
"overview-create-text-4",
"overview-create-text-5",
"overview-create-text-6",
"overview-create-text-7",
"overview-text-1",
"overview-text-2",
"overview-text-3",
"overview-text-4",
"overview-text-5",
"overview-text-6",
"overview-text-7",
"overview-text-8",
"overview-text-9",
"overview-text-10",
"overview-import-text-1",
"overview-import-text-2",
"overview-import-text-3",
"overview-import-text-4",
"overview-import-text-5",
"overview-import-text-6",
"overview-import-text-7",
"overview-import-text-8",
"overview-import-text-9",
"overview-load-text-1",
"overview-load-text-2",
"overview-load-text-3",
"overview-load-text-4",
"overview-load-text-5",
"overview-show-text-1",
"overview-show-text-2",
"overview-show-text-3",
"overview-show-text-4",
"overview-show-text-5",
"overview-show-text-6",
"overview-show-text-7",
"overview-show-text-8",
"overview-show-text-9",
"send-text-1",
"send-text-2",
"send-text-3",
"send-text-4",
"send-text-5",
"send-text-6",
"send-text-7",
"shortcuts-text-1",
"shortcuts-text-2",
"shortcuts-text-3",
"shortcuts-text-4",
"shortcuts-text-5",
"shortcuts-text-6",
"shortcuts-text-7",
"shortcuts-text-8",
"shortcuts-text-9",
"shortcuts-text-10",
"shortcuts-text-11",
"shortcuts-text-12",
"shortcuts-text-13",
"shortcuts-text-14"
]
}
Loading

0 comments on commit c9449ff

Please sign in to comment.