diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7363aed..957e3ddc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,13 @@ Some languages may use different words or phrases for different contexts where o Some strings to be translated may contain special characters. Different types of special character that may be encountered are: * Backslashes (`\`). These are used to escape backslashes and double-quotation marks (`"`) in the C++ translation strings. Don't add new backslashes into translations, and make sure all backslashes in the original string are retained in the translation. -* Formatting placeholders are used so that LOOT can substitute text or numbers that are generated at runtime into pre-made strings. They appear as a number surrounded by percentage signs, eg. `%1%`, or as `%s`. If formatting placeholders are used in the untranslated string, they **must all** be present in the translated string, or LOOT will crash when it tries to display the translated string. Placeholders can be moved around so that the sentence makes grammatical sense in the target language. +* Formatting placeholders are used so that LOOT can substitute text or numbers that are generated at runtime into pre-made strings. They appear in a few different formats: + 1. A number surrounded by percentage signs, eg. `%1%`. + 2. A named placeholder, eg. `%(icon)s` (the name in parentheses must not be changed). + 3. A simple placeholder `%s`. + + If formatting placeholders are used in the untranslated string, they **must all** be present in the translated string, or LOOT will encounter an error when it tries to display the translated string. Placeholders can be moved around so that the sentence makes grammatical sense in the target language. +* A small number of strings also include HTML `` elements that wrap translatable text. While the text inside the elements should be translated, the element tags and their attributes should not be. ### Adding A New Translation diff --git a/resources/l10n/template.pot b/resources/l10n/template.pot index 743f60e6..279c4571 100644 --- a/resources/l10n/template.pot +++ b/resources/l10n/template.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: LOOT 0.10.1\n" +"Project-Id-Version: LOOT 0.10.2\n" "Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n" -"POT-Creation-Date: 2016-12-20 15:36+0000\n" +"POT-Creation-Date: 2016-12-29 10:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -133,7 +133,7 @@ msgstr "" msgid "Error" msgstr "" -#: src/gui/html/js/initialise.js:250 +#: src/gui/html/js/initialise.js:249 #, javascript-format msgid "A [new release](%s) of LOOT is available." msgstr "" @@ -310,7 +310,7 @@ msgid "Editor Is Open" msgstr "" #: src/gui/html/js/translateStaticText.js:116 -#: src/gui/html/js/translateStaticText.js:308 +#: src/gui/html/js/translateStaticText.js:316 msgid "OK" msgstr "" @@ -601,36 +601,79 @@ msgid "First-Time Tips" msgstr "" #: src/gui/html/js/translateStaticText.js:302 +#, javascript-format +msgid "" +"This appears to be the first time you have run LOOT v%s. Here are some tips " +"to help you get started with the interface." +msgstr "" + +#: src/gui/html/js/translateStaticText.js:304 +msgid "Click %(menu_icon)s buttons to open menus." +msgstr "" + +#: src/gui/html/js/translateStaticText.js:307 +msgid "" +"As well as messages, LOOT displays plugin version " +"numbers, CRCs and Bash Tag suggestions for " +"addition and removal." +msgstr "" + +#: src/gui/html/js/translateStaticText.js:308 msgid "" "CRCs are only displayed after plugins have been loaded, either by conflict " "filtering, or by sorting." msgstr "" -#: src/gui/html/js/translateStaticText.js:303 +#: src/gui/html/js/translateStaticText.js:309 msgid "" "Double-click a plugin in the sidebar to quickly open it in the metadata " "editor." msgstr "" -#: src/gui/html/js/translateStaticText.js:304 +#: src/gui/html/js/translateStaticText.js:310 msgid "" "Plugins can be drag and dropped from the sidebar into the metadata editor's " "\"load after\", \"requirements\" and \"incompatibility\" tables." msgstr "" -#: src/gui/html/js/translateStaticText.js:305 +#: src/gui/html/js/translateStaticText.js:311 msgid "" "Some features are disabled while the metadata editor is open, or while there " "is a sorted load order that has not been applied or discarded." msgstr "" -#: src/gui/html/js/translateStaticText.js:306 +#: src/gui/html/js/translateStaticText.js:312 msgid "" "Many interface elements have tooltips. If you don't know what something is, " "try hovering your mouse over it to find out. Otherwise, LOOT's documentation " "can be accessed through the main menu." msgstr "" +#: src/gui/html/js/translateStaticText.js:314 +#: src/gui/html/js/translateStaticText.js:326 +#, javascript-format +msgid "" +"LOOT is free, but if you want to show your appreciation with some money, " +"donations may be made to WrinklyNinja (LOOT's creator and main developer) " +"using %s or %s." +msgstr "" + +#: src/gui/html/js/translateStaticText.js:321 +msgid "About LOOT" +msgstr "" + +#: src/gui/html/js/translateStaticText.js:323 +#, javascript-format +msgid "Version %s (build %s)" +msgstr "" + +#: src/gui/html/js/translateStaticText.js:324 +msgid "" +"Load order optimisation for Oblivion, Skyrim, Skyrim Special Edition, " +"Fallout 3, Fallout: New Vegas and Fallout 4." +msgstr "" + #: src/gui/query/get_game_data_query.h:44 msgid "Parsing, merging and evaluating metadata..." msgstr "" diff --git a/src/gui/html/index.html b/src/gui/html/index.html index 699ec2f8..9db44194 100644 --- a/src/gui/html/index.html +++ b/src/gui/html/index.html @@ -350,7 +350,7 @@ exit-animation="fade-out-animation">

About LOOT

-

Version (build )

+

Version unknown (build unknown)

Load order optimisation for Oblivion, Skyrim, Skyrim Special Edition, Fallout 3, Fallout: New Vegas and Fallout 4.

https://loot.github.io

LOOT is free, but if you want to show your appreciation with some money, donations may be made to WrinklyNinja (LOOT's creator and main developer) using PayPal or Bitcoin.

@@ -429,7 +429,7 @@ entry-animation="fade-in-animation" exit-animation="fade-out-animation">

First-Time Tips

-

This appears to be the first time you have run LOOT v. Here are some tips to help you get started with the interface.

+

This appears to be the first time you have run LOOT version unknown. Here are some tips to help you get started with the interface.

  • Click buttons to open menus.
  • As well as messages, LOOT displays plugin version numbers, CRCs and Bash Tag suggestions for addition and removal.
  • diff --git a/src/gui/html/js/dom.js b/src/gui/html/js/dom.js index 7c5458d4..5ebe7a42 100644 --- a/src/gui/html/js/dom.js +++ b/src/gui/html/js/dom.js @@ -192,12 +192,6 @@ document.getElementById('totalErrorNo').textContent = errorMessages.length; } - static setVersion(version) { - document.getElementById('LOOTVersion').textContent = version.release; - document.getElementById('firstTimeLootVersion').textContent = version.release; - document.getElementById('LOOTBuild').textContent = version.build; - } - static onJumpToGeneralInfo() { document.getElementById('pluginCardList').scroll(0, 0); } diff --git a/src/gui/html/js/initialise.js b/src/gui/html/js/initialise.js index e25dcf51..7762a202 100644 --- a/src/gui/html/js/initialise.js +++ b/src/gui/html/js/initialise.js @@ -121,8 +121,7 @@ function setVersion(appData) { return query('getVersion').then(JSON.parse).then((version) => { - appData.version = version.release; - dom.setVersion(version); + appData.version = version; }); } @@ -203,7 +202,7 @@ }); setupEventHandlers(); - loot.version = ''; + loot.version = {}; loot.settings = {}; loot.l10n = new Translator(); loot.game = new Game({}, loot.l10n); @@ -221,7 +220,7 @@ return loot.l10n.load(); }).then(() => { loot.filters = new Filters(loot.l10n); - translateStaticText(loot.l10n); + translateStaticText(loot.l10n, loot.version); /* Also need to update the settings UI. */ dom.updateSettingsDialog(loot.settings); dom.setGameMenuItems(loot.settings.games); @@ -233,7 +232,7 @@ .then(() => setGameData(loot)) .catch(handleInitErrors) .then(() => { - if (loot.settings.lastVersion !== loot.version) { + if (loot.settings.lastVersion !== loot.version.release) { dom.openDialog('firstRun'); } }) diff --git a/src/gui/html/js/translateStaticText.js b/src/gui/html/js/translateStaticText.js index 688e164c..1534f323 100644 --- a/src/gui/html/js/translateStaticText.js +++ b/src/gui/html/js/translateStaticText.js @@ -294,21 +294,39 @@ document.getElementById('settingsDialog').getElementsByClassName('cancel')[0].textContent = l10n.translate('Cancel'); } - function translateFirstRunDialog(l10n) { + function translateFirstRunDialog(l10n, version) { /* First-run dialog */ const firstRun = document.getElementById('firstRun'); firstRun.querySelector('h2').textContent = l10n.translate('First-Time Tips'); + firstRun.querySelector('p:first-of-type').innerHTML = l10n.translateFormatted('This appears to be the first time you have run LOOT v%s. Here are some tips to help you get started with the interface.', version.release); + + firstRun.querySelector('li:nth-child(1)').innerHTML = l10n.translateFormatted('Click %(menu_icon)s buttons to open menus.', { + menu_icon: '', + }); + firstRun.querySelector('li:nth-child(2)').innerHTML = l10n.translate('As well as messages, LOOT displays plugin version numbers, CRCs and Bash Tag suggestions for addition and removal.'); firstRun.querySelector('li:nth-child(3)').textContent = l10n.translate('CRCs are only displayed after plugins have been loaded, either by conflict filtering, or by sorting.'); firstRun.querySelector('li:nth-child(4)').textContent = l10n.translate('Double-click a plugin in the sidebar to quickly open it in the metadata editor.'); firstRun.querySelector('li:nth-child(5)').textContent = l10n.translate('Plugins can be drag and dropped from the sidebar into the metadata editor\'s "load after", "requirements" and "incompatibility" tables.'); firstRun.querySelector('li:nth-child(6)').textContent = l10n.translate('Some features are disabled while the metadata editor is open, or while there is a sorted load order that has not been applied or discarded.'); firstRun.querySelector('li:last-child').textContent = l10n.translate('Many interface elements have tooltips. If you don\'t know what something is, try hovering your mouse over it to find out. Otherwise, LOOT\'s documentation can be accessed through the main menu.'); + firstRun.querySelector('p:last-of-type').innerHTML = l10n.translateFormatted("LOOT is free, but if you want to show your appreciation with some money, donations may be made to WrinklyNinja (LOOT's creator and main developer) using %s or %s.", 'PayPal', 'Bitcoin'); + firstRun.getElementsByTagName('paper-button')[0].textContent = l10n.translate('OK'); } - return (l10n) => { + function translateAboutDialog(l10n, version) { + const about = document.getElementById('about'); + about.querySelector('h2').textContent = l10n.translate('About LOOT'); + + about.querySelector('p:nth-child(1)').innerHTML = l10n.translateFormatted('Version %s (build %s)', version.release, version.build); + about.querySelector('p:nth-child(2)').textContent = l10n.translate('Load order optimisation for Oblivion, Skyrim, Skyrim Special Edition, Fallout 3, Fallout: New Vegas and Fallout 4.'); + + about.querySelector('p:nth-child(4)').innerHTML = l10n.translateFormatted("LOOT is free, but if you want to show your appreciation with some money, donations may be made to WrinklyNinja (LOOT's creator and main developer) using %s or %s.", 'PayPal', 'Bitcoin'); + } + + return (l10n, version) => { translatePluginCardTemplate(l10n); translatePluginEditorTemplate(l10n); translatePluginListItemTemplate(l10n); @@ -328,6 +346,7 @@ translateSummaryCard(l10n); translateSettingsDialog(l10n); - translateFirstRunDialog(l10n); + translateFirstRunDialog(l10n, version); + translateAboutDialog(l10n, version); }; }));