diff --git a/htmlContent/mainDialog.html b/htmlContent/mainDialog.html index 18694af..aef5bcd 100644 --- a/htmlContent/mainDialog.html +++ b/htmlContent/mainDialog.html @@ -1,14 +1,13 @@
diff --git a/main.js b/main.js index b478813..fd6bdad 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ /* jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/* global define, brackets, $ */ +/* global define, brackets, $, require, Mustache */ /* HTML Skeleton @@ -17,22 +17,24 @@ define(function (require, exports, module) { "use strict"; // Import the required Brackets modules - var AppInit = brackets.getModule("utils/AppInit"), - CommandManager = brackets.getModule("command/CommandManager"), - Dialogs = brackets.getModule("widgets/Dialogs"), - Document = brackets.getModule("document/Document"), - EditorManager = brackets.getModule("editor/EditorManager"), - ExtensionUtils = brackets.getModule("utils/ExtensionUtils"), - Menus = brackets.getModule("command/Menus"), + var AppInit = brackets.getModule("utils/AppInit"), + CommandManager = brackets.getModule("command/CommandManager"), + Dialogs = brackets.getModule("widgets/Dialogs"), + Document = brackets.getModule("document/Document"), + EditorManager = brackets.getModule("editor/EditorManager"), + ExtensionUtils = brackets.getModule("utils/ExtensionUtils"), + Menus = brackets.getModule("command/Menus"), + + Strings = require("strings"), // Pull in the entire dialog - skellyDialogHtml = require("text!htmlContent/mainDialog.html"), + skellyDialogHtml = require("text!htmlContent/mainDialog.html"), // Grab our logo to display in the dialog - skellyLogo = require.toUrl("img/HTML-Skeleton.svg"), + skellyLogo = require.toUrl("img/HTML-Skeleton.svg"), // The extension ID - EXTENSION_ID = "le717.html-skeleton"; + EXTENSION_ID = "le717.html-skeleton"; /* ------- End Module Importing ------- */ @@ -178,7 +180,8 @@ define(function (require, exports, module) { function _showSkellyDialog() { /* Display the HTML Skeleton box */ - var skellyDialog = Dialogs.showModalDialogUsingTemplate(skellyDialogHtml), + var localized = Mustache.render(skellyDialogHtml, Strings); + var skellyDialog = Dialogs.showModalDialogUsingTemplate(localized), $doneButton = skellyDialog.getElement().find('.dialog-button[data-button-id="ok"]'); // Upon closing the dialog, run function to gather and apply choices @@ -212,7 +215,7 @@ define(function (require, exports, module) { ExtensionUtils.loadStyleSheet(module, "css/style.css"); // Assign a keyboard shortcut and item in Edit menu - CommandManager.register("Insert HTML elements\u2026", EXTENSION_ID, _showSkellyDialog); + CommandManager.register(Strings.INSERT_HTML_ELEMENTS, EXTENSION_ID, _showSkellyDialog); var menu = Menus.getMenu(Menus.AppMenuBar.EDIT_MENU); menu.addMenuItem(EXTENSION_ID, "Ctrl-Shift-N"); }); diff --git a/nls/de/strings.js b/nls/de/strings.js new file mode 100644 index 0000000..f82f789 --- /dev/null +++ b/nls/de/strings.js @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +*/ + +/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ +/*global define */ + +define({ + // menu + "INSERT_HTML_ELEMENTS" : "HTML Elemente einfügen\u2026", + + // mainDialog + "DIALOG_TITLE" : "HTML Skeleton", + "DIALOG_EXTENSION_DESCRIPTION" : "HTML Skeleton erlaubt Ihnen, verschiedene HTML-Elemente schnell und einfach in Ihr Dokument einzufügen.", + "USAGE" : "Benutzung", + "PLACE_CURSOR" : "Platzieren Sie den Cursor dort, wo die Elemente platziert werden sollen.", + "SELECT_ELEMENTS" : "Wählen Sie die benötigten Elemente aus.", + "CLICK_DONE" : "Klicken Sie auf 'Fertig' und die HTML-Elemente werden in Ihr Dokument eingefügt.", + "ELEMENTS" : "Elemente", + "HEAD_AND_BODY" : "Head- und Bodytag mit