Skip to content

TagSpaces is an offline, open source, document manager with tagging support

i18n-ing

Ilianc38faac2e29c
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index 9c2a5758c..cf3ad74c1 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -25,12 +25,13 @@
var perspectiveControl = $("<div class='form-inline'>")
.append($("<div class='input-group' style='width: 90%'>")
.append($("<select class='form-control' style='width: 70%'></select>"))
- .append($("<button class='btn btn-default' style='width: 40px' title='Remove Perspective'><i class='fa fa-times'></button>")
+ .append($("<button class='btn btn-default' style='width: 40px' data-i18n='[title]ns.dialogs:removePerspectiveTooltip'><i class='fa fa-times'></button>")
.click(function() {
$(this).parent().parent().remove();
})
)
- );
+ )
+ .i18n();
generateSelectOptions(perspectiveControl.find("select"), TSCORE.Config.getPerspectiveExtensions(), perspectiveId);
parent.append(perspectiveControl);
@@ -39,15 +40,16 @@
function addFileType(parent, fileext, viewerId, editorId) {
var fileTypeControl = $("<div class='form-inline'>")
.append($("<div class='input-group' >")
- .append($("<input style='width: 80px' type='text' class='form-control' placeholder='e.g: jpg'>").val(fileext))
- .append($("<select class='ftviewer form-control' style='width: 170px' placeholder='Select Viewer'></select>"))
- .append($("<select class='fteditor form-control' style='width: 170px' placeholder='Select Editor'></select>"))
- .append($("<button style='width: 40px' class='btn btn-default' title='Remove this file type'><i class='fa fa-times'></button>")
+ .append($("<input style='width: 80px' type='text' class='form-control' data-i18n='[placeholder]ns.dialogs:fileExtensionPlaceholder'>").val(fileext))
+ .append($("<select class='ftviewer form-control' style='width: 170px'></select>"))
+ .append($("<select class='fteditor form-control' style='width: 170px'></select>"))
+ .append($("<button style='width: 40px' class='btn btn-default' data-i18n='[title]ns.dialogs:removeFileTypeTooltip'><i class='fa fa-times'></button>")
.click(function() {
$(this).parent().parent().remove();
})
)
- );
+ )
+ .i18n();
generateSelectOptions(fileTypeControl.find(".ftviewer"), TSCORE.Config.getViewerExtensions(), viewerId);
generateSelectOptions(fileTypeControl.find(".fteditor"), TSCORE.Config.getEditorExtensions(), editorId);
parent.append(fileTypeControl);
@@ -76,9 +78,8 @@
$( "#defaultSettingsButton" ).click(function() {
TSCORE.showConfirmDialog(
- "Warning",
- "By restoring the defalt setting, all locations, tags and taggroups will be lost."+
- " Are you sure you want to continue?",
+ $.i18n.t("ns.dialogs:restoreDefaulSettingTitleConfirm"),
+ $.i18n.t("ns.dialogs:restoreDefaulSettingMessageConfirm"),
function() {
TSCORE.Config.loadDefaultSettings();
}
@@ -120,10 +121,10 @@
$('#fileTypesList')
.empty()
.append($("<div class='input-group' >")
- .append($("<span style='width: 80px; border: 0' class='form-control' >File Ext.</span>"))
- .append($("<span style=' border: 0; width: 170px' class='ftviewer form-control'>File Viewer</span>"))
- .append($("<span style=' border: 0; width: 170px' class='fteditor form-control'>File Editor</span>"))
- );
+ .append($("<span style='width: 80px; border: 0' class='form-control' data-i18n='ns.dialogs:fileExtension'></span>"))
+ .append($("<span style=' border: 0; width: 170px' class='ftviewer form-control' data-i18n='ns.dialogs:fileViewer'></span>"))
+ .append($("<span style=' border: 0; width: 170px' class='fteditor form-control' data-i18n='ns.dialogs:fileEditor'></span>"))
+ ).i18n();
TSCORE.Config.getSupportedFileTypes().forEach(function (value) {
addFileType($('#fileTypesList'), value.type, value.viewer, value.editor);
@@ -160,7 +161,6 @@
TSCORE.Config.setInterfaceLangauge(interfaceLang);
TSCORE.switchInterfaceLanguage(interfaceLang);
-
TSCORE.Config.setPerspectives(collectPerspectivesData());
TSCORE.Config.setSupportedFileTypes(collectSupportedFileTypesData());
@@ -196,7 +196,6 @@
return data;
}
-
// Public Methods
exports.initUI = initUI;
exports.reInitUI = reInitUI;
diff --git a/data/locales/en/ns.common.json b/data/locales/en/ns.common.json
index b588e3704..8240ae841 100644
--- a/data/locales/en/ns.common.json
+++ b/data/locales/en/ns.common.json
@@ -33,7 +33,7 @@
"editFile": "Edit File",
"saveFileTooltip": "Save current file",
"saveFile": "Save File",
- "toggleFullWidthTooltip": "Open the file in the full width ot TagSpaces",
+ "toggleFullWidthTooltip": "Open the file in the full width of TagSpaces",
"toggleFullWidth": "Toggle Full Width",
"openPrevFileTooltip": "Open previous file",
"openPrevFile": "Previous File",
diff --git a/data/locales/en/ns.dialogs.json b/data/locales/en/ns.dialogs.json
index ab2c0d66c..834a7cd67 100644
--- a/data/locales/en/ns.dialogs.json
+++ b/data/locales/en/ns.dialogs.json
@@ -73,15 +73,44 @@
"editLocationDefaultPerspective": "Default Perspective",
"removeLocation": "Remove Location",
"locationPathSelectFolder": "Select local folder",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
- "": "",
+ "optionsTitle": "Options",
+ "generalTab": "General",
+ "perspectivesTab": "Perspectives",
+ "fileTypeTab": "File Types",
+ "keyBindingsTab": "Key Bindings",
+ "experimentalTab": "Experimental*",
+ "fileExtension": "File Ext.",
+ "fileExtensionPlaceholder": "e.g.: jpg",
+ "fileViewer": "File Viewer",
+ "fileEditor": "File Editor",
+ "restoreDefaulSettingButton": "Restore Initial Settings",
+ "restoreDefaulSettingTitleConfirm": "Restoring Default Settings",
+ "restoreDefaulSettingMessageConfirm": "By restoring the defalt setting, all locations, tags and taggroups will be lost.Are you sure you want to continue?",
+ "removeFileTypeTooltip": "Remove this file type",
+ "removePerspectiveTooltip": "Remove Perspective",
+ "switchLanguageHelp": "Switching language will fully take effect after restarting the application",
+ "keyBindingInstructions": "Instructions",
+ "keyBindingInstructions1": "For modifier keys you can use",
+ "keyBindingInstructions2": "Other special keys are",
+ "keyBindingInstructions3": "Any other key you should be able to reference by name like",
+ "keyBindingInstructions4": "You can assign many keys to a single operation, simpy by separating them by",
+ "reloadDocumentKeyBinding": "Reload Document",
+ "closeDocumentKeyBinding": "Close Document",
+ "documentPropertiesKeyBinding": "Document Properties",
+ "saveDocumentKeyBinding": "Save Document",
+ "nextDocumentKeyBinding": "Next Document",
+ "prevDocumentKeyBinding": "Previous Document",
+ "perspectivesHelp": "The changes made in this tab will take effect after restarting the application.",
+ "addPerspectiveButton": "Add new perspective",
+ "addNewFileExtensionButton": "Add new file extension",
+ "showUnixHiddenFiles": "Show files/directories with a dot(.) in front of the name (e.g. Unix, Linux, OS X hidden files)",
+ "checkForNewVersion": "Check for new version on startup",
+ "experimentalHelp": "*) Be carefull changing the following settings.",
+ "extensionsFolder": "Extensions folder (default value is 'ext')",
+ "extensionsFolderPlaceholder": "file:///c:\\tagspaces-extensions;[title]app",
+ "calculateTag": "Calculate tags from the current search results",
+ "calculateTagHelp": "Reduces the performance while browsing directories",
+ "tagDelimiter": "Tag delimiter (e.g. Filename[TAG1_TAG2], _ is the delimiter)",
+ "prefixTagContainer": "Prefix for the tag container (e.g. in 'Filename_[TAG1].txt', '_' is the prefix)",
"-": "-"
}
\ No newline at end of file
diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.html
index b3400a762..22b2876e2 100644
--- a/data/templates/OptionsDialog.html
+++ b/data/templates/OptionsDialog.html
@@ -2,65 +2,66 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i
- class="fa fa-times fa-lg"></i></button>
- <h4>Options</h4>
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
+ <i class="fa fa-times fa-lg"></i>
+ </button>
+ <h4 data-i18n="ns.dialogs:optionsTitle">Settings</h4>
</div>
<div class="modal-body form" style="height: 408px;" id="optionsAccordion">
<ul class="nav nav-tabs">
- <li><a href="#general" data-toggle="tab" class="optionsTitle">General</a></li>
- <li><a href="#perspectives" data-toggle="tab" class="optionsTitle">Perspectives</a></li>
- <li><a href="#filetypes" data-toggle="tab" class="optionsTitle">File Types</a></li>
- <li><a href="#keyBindings" data-toggle="tab" class="optionsTitle">Key Bindings</a></li>
- <li><a href="#experimental" data-toggle="tab" class="optionsTitle">Experimental*</a></li>
+ <li><a href="#general" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:generalTab">General</a></li>
+ <li><a href="#perspectives" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:perspectivesTab">Perspectives</a></li>
+ <li><a href="#filetypes" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:fileTypeTab">File Types</a></li>
+ <li><a href="#keyBindings" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:keyBindingsTab">Key Bindings</a></li>
+ <li><a href="#experimental" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:experimentalTab">Experimental*</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="general" style="height: 320px; padding-top: 10px; overflow-y: auto;">
<div class='form-group col-sm-12'>
- <label for='languagesList' data-i18n="">Interface Language</label>
+ <label for='languagesList'>Interface Language</label>
<select class='form-control' id='languagesList'></select>
- <p class="help-block">Switching language will fully take effect after restarting the application</p>
+ <p class="help-block" data-i18n="ns.dialogs:switchLanguageHelp">Switching language will fully take effect after restarting the application</p>
</div>
<div class='form-group col-sm-12'>
<label class="checkbox">
<input type='checkbox' id='showHiddenFilesCheckbox'/>
- Show files/directories with a dot(.) in front of the name (e.g. Unix, Linux, OS X hidden files)
+ <span data-i18n="ns.dialogs:showUnixHiddenFiles">Show files/directories with a dot(.) in front of the name (e.g. Unix, Linux, OS X hidden files)</span>
</label>
</div>
<div class='form-group col-sm-12'>
<label class="checkbox">
<input type='checkbox' id='checkforUpdatesCheckbox'/>
- Check for new version on startup
+ <span data-i18n="ns.dialogs:checkForNewVersion">Check for new version on startup</span>
</label>
</div>
<div class='form-group col-sm-12'>
- <button class="btn btn-danger" id="defaultSettingsButton" title="Restore Initial Settings" aria-hidden="true">Reset Settings</button>
+ <button class="btn btn-danger" id="defaultSettingsButton" aria-hidden="true" data-i18n="ns.dialogs:restoreDefaulSettingButton">Restore Initial Settings</button>
</div>
</div>
<div class="tab-pane" id="perspectives" style="height: 320px; padding-top: 10px; overflow-y: auto;">
- <p class="help-block">The changes made in this tab will take effect after restarting the application.</p>
+ <p class="help-block" data-i18n="ns.dialogs:perspectivesHelp">The changes made in this tab will take effect after restarting the application.</p>
<div id='perspectiveList'></div>
<button class='btn btn-default' style="margin-top: 10px" id='addPerspectiveButton'>
- <i class='fa fa-plus'></i>&nbsp;<span data-i18n="app.addNewPerspective">Add new perspective</span>
+ <i class='fa fa-plus'></i>&nbsp;<span data-i18n="ns.dialogs:addPerspectiveButton">Add new perspective</span>
</button>
</div>
<div class="tab-pane" id="filetypes" style="height: 320px; padding-top: 10px; overflow-y: auto;">
<div id='fileTypesList'></div>
<button class='btn btn-default' style="margin-top: 10px" id='addFileTypeButton'>
- <i class='fa fa-plus'></i>&nbsp;<span data-i18n="app.addNewFileExtension">Add new file extension</span>
+ <i class='fa fa-plus'></i>&nbsp;<span data-i18n="ns.dialogs:addNewFileExtensionButton">Add new file extension</span>
</button>
</div>
<div class="tab-pane" id="keyBindings" style="height: 320px; overflow-y: auto; overflow-x: hidden;">
<form class="form-horizontal" role="form">
<div class='form-group col-sm-12'>
- <p class="help-block" data-i18n="ns.dialogs:" style="margin-top: 20px; font-weight: bold">Instructions:</p>
- <p class="help-block"><span data-i18n="ns.dialogs:">For modifier keys you can use </span><code>shift</code>, <code>ctrl</code>, <code>alt</code>, <code>option</code>, <code>meta</code> &amp; <code>command</code>.</p>
- <p class="help-block"><span data-i18n="ns.dialogs:">Other special keys are </span><code>backspace</code>, <code>tab</code>, <code>enter</code>, <code>return</code>, <code>capslock</code>, <code>esc</code>, <code>escape</code>, <code>space</code>, <code>pageup</code>, <code>pagedown</code>, <code>end</code>, <code>home</code>, <code>left</code>, <code>up</code>, <code>right</code>, <code>down</code>, <code>ins</code> &amp; <code>del</code>.</p>
- <p class="help-block"><span data-i18n="ns.dialogs:">Any other key you should be able to reference by name like </span><code>a</code>, <code>/</code>, <code>$</code>, <code>*</code>, <code>=</code>.</p>
- <p class="help-block"><span data-i18n="ns.dialogs:">You can assign many keys to a single operation, simpy by separating them by </span><code>,</code>.</p>
+ <p class="help-block" data-i18n="ns.dialogs:keyBindingInstructions" style="margin-top: 20px; font-weight: bold">Instructions:</p>
+ <p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions1">For modifier keys you can use</span>&nbsp;<code>shift</code>, <code>ctrl</code>, <code>alt</code>, <code>option</code>, <code>meta</code> &amp; <code>command</code>.</p>
+ <p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions2">Other special keys are</span>&nbsp;<code>backspace</code>, <code>tab</code>, <code>enter</code>, <code>return</code>, <code>capslock</code>, <code>esc</code>, <code>escape</code>, <code>space</code>, <code>pageup</code>, <code>pagedown</code>, <code>end</code>, <code>home</code>, <code>left</code>, <code>up</code>, <code>right</code>, <code>down</code>, <code>ins</code> &amp; <code>del</code>.</p>
+ <p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions3">Any other key you should be able to reference by name like</span>&nbsp;<code>a</code>, <code>/</code>, <code>$</code>, <code>*</code>, <code>=</code>.</p>
+ <p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions4">You can assign many keys to a single operation, simpy by separating them by</span>&nbsp;<code>,</code>.</p>
</div>
<div class='form-group'>
<label class="col-sm-4 control-label" data-i18n="ns.dialogs:reloadDocumentKeyBinding">Reload Document</label>
@@ -108,33 +109,25 @@
</div>
<div class="tab-pane" id="experimental" style="height: 320px; padding-top: 10px; overflow-y: auto;">
- <p class="help-block col-sm-12">*) Be carefull changing the following settings.</p>
+ <p class="help-block col-sm-12" data-i18n="ns.dialogs:experimentalHelp">*) Be carefull changing the following settings.</p>
<div class='form-group col-sm-12'>
- <label for='extensionsPathInput' data-i18n="app.extensionsFolder">Extensions folder (default value is "ext")</label>
- <input type='text' class='form-control' id='extensionsPathInput'
- data-i18n="[placeholder]app" placeholder='file:///c:\\tagspaces-extensions;[title]app' title='Path to your tagspaces extensions'/>
+ <label for='extensionsPathInput' data-i18n="ns.dialogs:extensionsFolder">Extensions folder (default value is "ext")</label>
+ <input type='text' class='form-control' id='extensionsPathInput' data-i18n="[placeholder]ns.dialogs:extensionsFolderPlaceholder"/>
</div>
- <!--button class="btn btn-default" style="margin-bottom: 10px" id="switchLang" data-i18n="[title]app.switchLanguageTooltip;">
- <i class="fa fa-asterisk"> Test Change Language</i>
- </button-->
<div class='form-group col-sm-12'>
<label class="checkbox">
<input type='checkbox' id='calculateTagsCheckbox'/>
- Calculate tags from the current search results
+ <span data-i18n="ns.dialogs:calculateTag">Calculate tags from the current search results</span>
</label>
-
- <p class="help-block">Reduces the performance while browsing directories</p>
+ <p class="help-block" data-i18n="ns.dialogs:calculateTagHelp">Reduces the performance while browsing directories</p>
</div>
<div class='form-group col-sm-12'>
- <label for='tagsDelimiterInput' data-i18n="app.extensionsFolder">Tag delimiter (e.g.
- Filename[TAG1_TAG2], _ is the delimiter)</label>
- <input type='text' class='form-control' id='tagsDelimiterInput'
- data-i18n="[placeholder]app;[title]app" placeholder='' title=''/>
+ <label for='tagsDelimiterInput' data-i18n="ns.dialogs:tagDelimiter">Tag delimiter (e.g. Filename[TAG1_TAG2], _ is the delimiter)</label>
+ <input type='text' class='form-control' id='tagsDelimiterInput' data-i18n="" />
</div>
<div class='form-group col-sm-12'>
- <label for='prefixTagContainerInput' data-i18n="app.extensionsFolder">Prefix for the tag
- container (e.g. in "Filename-[TAG1].txt" - is the prefix) </label>
- <input type='text' class='form-control' id='prefixTagContainerInput' data-i18n="[placeholder]app;[title]app"/>
+ <label for='prefixTagContainerInput' data-i18n="ns.dialogs:prefixTagContainer">Prefix for the tag container (e.g. in "Filename-[TAG1].txt" - is the prefix)</label>
+ <input type='text' class='form-control' id='prefixTagContainerInput' data-i18n=""/>
</div>
</div>
</div>