TagSpaces is an offline, open source, document manager with tagging support
added localization messages
Borislav Sapundzhiev7154434ecf7c
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.jsindex cb3c057da..5904d4616 100644--- a/data/cordova/cordova.api.js+++ b/data/cordova/cordova.api.js@@ -499,7 +499,7 @@ define(function(require, exports, module) {});} else {- TSCORE.showAlertDialog("File Already Exists.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileExists", { fileName:filePath }));}};@@ -670,7 +670,7 @@ define(function(require, exports, module) {};var openExtensionsDirectory = function() {- TSCORE.showAlertDialog("Open extensions directory functionality not supported on Android!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:openExtentionDirectoryNotSupported"));};var getFileProperties = function(filePath) {diff --git a/data/locales/en_US/ns.common.json b/data/locales/en_US/ns.common.jsonindex a17cf4029..4f885460d 100644--- a/data/locales/en_US/ns.common.json+++ b/data/locales/en_US/ns.common.json@@ -158,5 +158,24 @@"help": "Help","settings": "Settings","confirmApplicationClose": "There is unsaved file. Do you really want to quit the application?",+ "waitDialogDiectoryIndexing": "TagSpaces is indexing the current directory with subdirectories.",+ "waitDialogDiectoryTree": "TagSpaces is creating the structure tree of the current directory.",+ "fileTheSame": "Initial and target file names are the same.",+ "fileNotCopyied": "File was not copyied.",+ "fileNotMoved": "File was not moved/renamed.",+ "fileIsDirectory": "'__fileName__' is a directory and can not be moved",+ "fileExists": "Target file '__fileName__' already exists.",+ "fileRenameFailed": "File renaming failed!",+ "fileRenameFailedDiffPartition": "Renaming of '__fileName__' failed. The file is probably on a different partition.",+ "fileCopyFailed": "Copying of '__fileName__' failed.",+ "directoryTheSame": "Initial and target directories are the same.",+ "directoryNotMoved": "Directory was not renamed.",+ "directoryExists": "Target directory name '__dirName__' already exists.",+ "directoryRenameFailed": "Directory renaming failed!",+ "directoryRenameNotImplemented" : "Rename directory functionality is not implemented yet.",+ "directoryDeleteNotImplemented" : "Delete directory functionality is not implemented yet.",+ "pathIsNotDirectory": "Path '__dirName__' is not a directory.",+ "openExtentionDirectoryNotImplemented": "Open extensions directory functionality not implemented yet!",+ "openExtentionDirectoryNotSupported": "Open extensions directory functionality not supported on this platform!","-": "-"}\ No newline at end of filediff --git a/data/mozilla/mozilla.api.js b/data/mozilla/mozilla.api.jsindex 4413794b4..3cb050a0b 100644--- a/data/mozilla/mozilla.api.js+++ b/data/mozilla/mozilla.api.js@@ -211,7 +211,7 @@ define(function(require, exports, module) {};var renameDirectory = function(filePath, newFilePath) {- TSCORE.showAlertDialog("Rename directory functionality is not implemented in firefox yet.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:directoryRenameNotImplemented"));};var saveTextFile = function(filePath, content) {@@ -271,7 +271,7 @@ define(function(require, exports, module) {};var deleteDirectory = function(dirPath) {- TSCORE.showAlertDialog("Delete directory functionality is not implemented in Firefox yet.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:directoryDeleteNotImplemented"));};var checkAccessFileURLAllowed = function() {diff --git a/data/node-webkit/node-webkit.api.js b/data/node-webkit/node-webkit.api.jsindex 642949b00..c59446740 100644--- a/data/node-webkit/node-webkit.api.js+++ b/data/node-webkit/node-webkit.api.js@@ -252,7 +252,7 @@ define(function(require, exports, module) {var createDirectoryIndex = function(dirPath) {console.log("Creating index for directory: " + dirPath);- TSCORE.showWaitingDialog("TagSpaces is indexing the current directory with subdirectories.");+ TSCORE.showWaitingDialog($.i18n.t("ns.common:waitDialogDiectoryIndexing"));var directoryIndex = [];directoryIndex = scanDirectory(dirPath, directoryIndex);@@ -262,7 +262,7 @@ define(function(require, exports, module) {var createDirectoryTree = function(dirPath) {console.log("Creating directory index for: " + dirPath);- TSCORE.showWaitingDialog("TagSpaces is creating the structure tree of the current directory.");+ TSCORE.showWaitingDialog($.i18n.t("ns.common:waitDialogDiectoryIndexing"));var directoyTree = generateDirectoryTree(dirPath);//console.log(JSON.stringify(directoyTree));@@ -286,29 +286,29 @@ define(function(require, exports, module) {if (sourceFilePath.toLowerCase() === targetFilePath.toLowerCase()) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Initial and target file names are the same.", "File was not copyied.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileTheSame"), $.i18n.t("ns.common:fileNotCopyied"));return false;}if (fs.lstatSync(sourceFilePath).isDirectory()) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("'" + sourceFilePath + "' is a directory and can not be moved.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileIsDirectory", { fileName:sourceFilePath }));return false;}if (fs.existsSync(targetFilePath)) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Target file '" + targetFilePath + "' already exists.", "File renaming failed!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileExists", { fileName:targetFilePath }), $.i18n.t("ns.common:fileRenameFailed"));return false;}var rd = fs.createReadStream(sourceFilePath);rd.on("error", function(err) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Copying of '" + sourceFilePath + "' failed.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileCopyFailed", { fileName:sourceFilePath }));});var wr = fs.createWriteStream(targetFilePath);wr.on("error", function(err) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Copying of '" + sourceFilePath + "' failed.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileCopyFailed", { fileName:sourceFilePath }));});wr.on("close", function(ex) {TSPOSTIO.copyFile(sourceFilePath, targetFilePath);@@ -321,23 +321,23 @@ define(function(require, exports, module) {if (filePath === newFilePath) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Initial and target file names are the same.", "File was not moved/renamed.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileTheSame"), $.i18n.t("ns.common:fileNotMoved"));return false;}if (fs.lstatSync(filePath).isDirectory()) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("'" + filePath + "' is a directory and can not be moved.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileIsDirectory", { fileName:filePath }));return false;}if (fs.existsSync(newFilePath)) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Target file '" + newFilePath + "' already exists.", "File renaming failed!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileExists", { fileName:newFilePath }), $.i18n.t("ns.common:fileRenameFailed"));return false;}fs.rename(filePath, newFilePath, function(error) {if (error) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Renaming of '" + filePath + "' failed. The file is probably on a different partition.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileRenameFailedDiffPartition", { fileName:filePath }));return;}TSPOSTIO.renameFile(filePath, newFilePath);@@ -352,12 +352,12 @@ define(function(require, exports, module) {if (dirPath === newDirPath) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Initial and target directories are the same.", "Directory was not renamed.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:directoryTheSame"), $.i18n.t("ns.common:directoryNotMoved"));return false;}if (fs.existsSync(newDirPath)) {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Target directory name '" + newDirPath + "' already exists.", "Directory renaming failed!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:directoryExists", { dirName:newDirPath }), $.i18n.t("ns.common:directoryRenameFailed"));return false;}var dirStatus = fs.lstatSync(dirPath);@@ -371,7 +371,7 @@ define(function(require, exports, module) {});} else {TSCORE.hideWaitingDialog();- TSCORE.showAlertDialog("Path '" + dirPath + "' is not a directory.", "Directory renaming failed!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:pathIsNotDirectory", { dirName:dirPath }), $.i18n.t("ns.common:directoryRenameFailed"));return false;}};@@ -459,7 +459,7 @@ define(function(require, exports, module) {TSPOSTIO.saveBinaryFile(filePath);});} else {- TSCORE.showAlertDialog("File Already Exists.");+ TSCORE.showAlertDialog($.i18n.t("ns.common:fileExists", {fileName: filePath}));}};@@ -593,7 +593,7 @@ define(function(require, exports, module) {// TODO implement openExtensionsDirectory on node//gui.Shell.openItem(extPath);console.log("Open extensions directory functionality not implemented on chrome yet!");- TSCORE.showAlertDialog("Open extensions directory functionality not implemented yet!");+ TSCORE.showAlertDialog($.i18n.t("ns.common:openExtentionDirectoryNotImplemented"));};/* stats for file: