Merge pull request #806 from McGiverGim/bf-i18n_console

More i18n, GUI Console
10.3.x-maintenance
Michael Keller 2017-12-21 14:27:41 +13:00 committed by GitHub
commit 186e47e06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 12 deletions

View File

@ -213,6 +213,9 @@
"message": "The firmware on this device needs upgrading to a newer version. Use CLI for backup before flashing. CLI backup/restore procedure is in the documention.<br />Alternatively download and use an old version of the configurator if you are not ready to upgrade." "message": "The firmware on this device needs upgrading to a newer version. Use CLI for backup before flashing. CLI backup/restore procedure is in the documention.<br />Alternatively download and use an old version of the configurator if you are not ready to upgrade."
}, },
"infoVersions": {
"message" : "Running - OS: <strong>$1</strong>, Chrome: <strong>$2</strong>, Configurator: <strong>$3</strong>"
},
"tabSwitchConnectionRequired": { "tabSwitchConnectionRequired": {
"message": "You need to <strong>connect</strong> before you can view any of the tabs." "message": "You need to <strong>connect</strong> before you can view any of the tabs."
}, },
@ -1676,7 +1679,7 @@
"message": "Sonar - cm" "message": "Sonar - cm"
}, },
"sensorsDebugTitle": { "sensorsDebugTitle": {
"message": "Debug 0" "message": "Debug"
}, },
"cliInfo": { "cliInfo": {
@ -2001,6 +2004,21 @@
"firmwareFlasherFailedToLoadOnlineFirmware": { "firmwareFlasherFailedToLoadOnlineFirmware": {
"message": "Failed to load remote firmware" "message": "Failed to load remote firmware"
}, },
"firmwareFlasherNoFirmwareSelected": {
"message": "<b>No firmware selected to load</b>"
},
"firmwareFlasherNoValidPort": {
"message": "<span class=\"message-negative\">Please select valid serial port</span>"
},
"firmwareFlasherWritePermissions": {
"message": "You don't have <span class=\"message-negative\">write permissions</span> for this file"
},
"firmwareFlasherFlashTrigger": {
"message": "Detected: <strong>$1</strong> - triggering flash on connect"
},
"firmwareFlasherPreviousDevice": {
"message": "Detected: <strong>$1</strong> - previous device still flashing, please replug to try again"
},
"ledStripHelp": { "ledStripHelp": {
"message": "The flight controller can control colors and effects of individual LEDs on a strip.<br />Configure LEDs on the grid, configure wiring order then attach LEDs on your aircraft according to grid positions. LEDs without wire ordering number will not be saved.<br />Double-click on a color to edit the HSV values." "message": "The flight controller can control colors and effects of individual LEDs on a strip.<br />Configure LEDs on the grid, configure wiring order then attach LEDs on your aircraft according to grid positions. LEDs without wire ordering number will not be saved.<br />Double-click on a color to edit the HSV values."
@ -2879,6 +2897,12 @@
"osdSectionHelpWarnings": { "osdSectionHelpWarnings": {
"message": "Enable or disable warnings that are shown on the WARNINGS element." "message": "Enable or disable warnings that are shown on the WARNINGS element."
}, },
"osdSettingsSaved": {
"message": "OSD settings saved"
},
"osdWritePermissions": {
"message": "You don't have <span class=\"message-negative\">write permissions</span> for this file"
},
"mainHelpArmed": { "mainHelpArmed": {
"message": "Motor Arming" "message": "Motor Arming"

View File

@ -21,9 +21,7 @@ $(document).ready(function () {
localize(); localize();
// alternative - window.navigator.appVersion.match(/Chrome\/([0-9.]*)/)[1]; // alternative - window.navigator.appVersion.match(/Chrome\/([0-9.]*)/)[1];
GUI.log('Running - OS: <strong>' + GUI.operating_system + '</strong>, ' + GUI.log(chrome.i18n.getMessage('infoVersions',[GUI.operating_system, window.navigator.appVersion.replace(/.*Chrome\/([0-9.]*).*/, "$1"), getManifestVersion()]));
'Chrome: <strong>' + window.navigator.appVersion.replace(/.*Chrome\/([0-9.]*).*/, "$1") + '</strong>, ' +
'Configurator: <strong>' + getManifestVersion() + '</strong>');
$('#logo .version').text(getManifestVersion()); $('#logo .version').text(getManifestVersion());
updateStatusBarVersion(); updateStatusBarVersion();

View File

@ -237,7 +237,7 @@ TABS.firmware_flasher.initialize = function (callback) {
$('a.load_remote_file').click(function (evt) { $('a.load_remote_file').click(function (evt) {
if ($('select[name="firmware_version"]').val() == "0") { if ($('select[name="firmware_version"]').val() == "0") {
GUI.log("<b>No firmware selected to load</b>"); GUI.log(chrome.i18n.getMessage('firmwareFlasherNoFirmwareSelected'));
return; return;
} }
@ -322,7 +322,7 @@ TABS.firmware_flasher.initialize = function (callback) {
STM32.connect(port, baud, parsed_hex, options); STM32.connect(port, baud, parsed_hex, options);
} else { } else {
console.log('Please select valid serial port'); console.log('Please select valid serial port');
GUI.log('<span style="color: red">Please select valid serial port</span>'); GUI.log(chrome.i18n.getMessage('firmwareFlasherNoValidPort'));
} }
} else { } else {
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex, options); STM32DFU.connect(usbDevices.STM32DFU, parsed_hex, options);
@ -373,7 +373,7 @@ TABS.firmware_flasher.initialize = function (callback) {
}); });
} else { } else {
console.log('You don\'t have write permissions for this file, sorry.'); console.log('You don\'t have write permissions for this file, sorry.');
GUI.log('You don\'t have <span style="color: red">write permissions</span> for this file'); GUI.log(chrome.i18n.getMessage('firmwareFlasherWritePermissions'));
} }
}); });
}); });
@ -442,7 +442,7 @@ TABS.firmware_flasher.initialize = function (callback) {
var port = result[0]; var port = result[0];
if (!GUI.connect_lock) { if (!GUI.connect_lock) {
GUI.log('Detected: <strong>' + port + '</strong> - triggering flash on connect'); GUI.log(chrome.i18n.getMessage('firmwareFlasherFlashTrigger', [port]));
console.log('Detected: ' + port + ' - triggering flash on connect'); console.log('Detected: ' + port + ' - triggering flash on connect');
// Trigger regular Flashing sequence // Trigger regular Flashing sequence
@ -450,7 +450,7 @@ TABS.firmware_flasher.initialize = function (callback) {
$('a.flash_firmware').click(); $('a.flash_firmware').click();
}, 100); // timeout so bus have time to initialize after being detected by the system }, 100); // timeout so bus have time to initialize after being detected by the system
} else { } else {
GUI.log('Detected <strong>' + port + '</strong> - previous device still flashing, please replug to try again'); GUI.log(chrome.i18n.getMessage('firmwareFlasherPreviousDevice', [port]));
} }
// Since current port_detected request was consumed, create new one // Since current port_detected request was consumed, create new one

View File

@ -39,7 +39,7 @@
</div> </div>
<div id="changelog"> <div id="changelog">
<div class="button"> <div class="button">
<a id="changelog_toggle" href="#">Changelog</a> <a id="changelog_toggle" href="#" i18n="defaultChangelogAction"></a>
</div> </div>
<div class="wrapper"> <div class="wrapper">
<div class="title" i18n="defaultChangelogHead"></div> <div class="title" i18n="defaultChangelogHead"></div>

View File

@ -1653,7 +1653,7 @@ TABS.osd.initialize = function (callback) {
$('a.save').click(function() { $('a.save').click(function() {
var self = this; var self = this;
MSP.promise(MSPCodes.MSP_EEPROM_WRITE); MSP.promise(MSPCodes.MSP_EEPROM_WRITE);
GUI.log('OSD settings saved'); GUI.log(chrome.i18n.getMessage('osdSettingsSaved'));
var oldText = $(this).text(); var oldText = $(this).text();
$(this).html("Saved"); $(this).html("Saved");
setTimeout(function () { setTimeout(function () {
@ -1761,7 +1761,7 @@ TABS.osd.initialize = function (callback) {
}); });
} else { } else {
console.log('You don\'t have write permissions for this file, sorry.'); console.log('You don\'t have write permissions for this file, sorry.');
GUI.log('You don\'t have <span style="color: red">write permissions</span> for this file'); GUI.log(chrome.i18n.getMessage('osdWritePermissions'));
} }
}); });
}); });