1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

firmware flasher i18n support

This commit is contained in:
cTn 2014-05-08 12:01:07 +02:00
parent 7207f2a525
commit 96ce646aa1
3 changed files with 112 additions and 37 deletions

View file

@ -430,5 +430,78 @@
},
"cliInputPlaceholder": {
"message": "Write your command here"
},
"firmwareFlasherPath": {
"message": "Path:"
},
"firmwareFlasherSize": {
"message": "Size:"
},
"firmwareFlasherStatus": {
"message": "Status:"
},
"firmwareFlasherProgress": {
"message": "Progress:"
},
"firmwareFlasherNote": {
"message": "If you are flashing board with <strong>baseflight</strong> already flashed (updating), leave this checkbox unchecked.<br />If you are flashing \"<strong>bare</strong>\" board with no firmware preloaded or you have bootloader pins <strong>shorted</strong>, check this box.<br />"
},
"firmwareFlasherNoReboot": {
"message": "No reboot sequence"
},
"firmwareFlasherFlashOnConnect": {
"message": "Flash on connect"
},
"firmwareFlasherFullChipErase": {
"message": "Full Chip Erase"
},
"firmwareFlasherButtonLoadLocal": {
"message": "Load Firmware [Local]"
},
"firmwareFlasherButtonLoadOnline": {
"message": "Load Firmware [Online]"
},
"firmwareFlasherFlashFirmware": {
"message": "Flash Firmware"
},
"firmwareFlasherGithubInfoHead": {
"message": "Github Firmware Info"
},
"firmwareFlasherCommiter": {
"message": "Committer:"
},
"firmwareFlasherDate": {
"message": "Date:"
},
"firmwareFlasherMessage": {
"message": "Message:"
},
"firmwareFlasherWarninghead": {
"message": "Warning"
},
"firmwareFlasherWarningText": {
"message": "Please do not try to flash <strong>non-baseflight</strong> hardware with this firmware flasher (it wont work).<br />Do not <strong>disconnect</strong> the board or <strong>turn off</strong> your computer while flashing.<br /><br />Note: <strong>STM32</strong> bootloader is stored in <strong>ROM</strong>, it cannot be bricked.<br />Note: <strong>Auto-Connect</strong> is always disabled while you are inside firmware flasher.<br />"
},
"firmwareFlasherButtonLeave": {
"message": "Leave Firmware Flasher"
},
"firmwareFlasherFirmwareNotLoaded": {
"message": "<span style=\"color: red\">Firmware not loaded</span>"
},
"firmwareFlasherFirmwareLoaded": {
"message": "<span style=\"color: green\">Firmware loaded, ready for flashing</span>"
},
"firmwareFlasherHexCorrupted": {
"message": "<span style=\"color: red\">HEX file appears to be corrupted</span>"
},
"firmwareFlasherRemoteFirmwareLoaded": {
"message": "<span style=\"color: green\">Remote Firmware loaded, ready for flashing</span>"
},
"firmwareFlasherFailedToLoadOnlineFirmware": {
"message": "<span style=\"color: red\">Failed to load remote firmware</span>"
},
"firmwareFlasherWaitForFinish": {
"message": "You <span style=\"color: red\">can't</span> do this right now, please wait for current operation to finish ..."
}
}

View file

@ -1,43 +1,45 @@
<div class="tab-firmware_flasher">
<div class="info">
<strong>Path:</strong><span class="path">empty</span><br />
<strong>Size:</strong><span class="size">0 bytes</span><br />
<strong>Status:</strong><span class="status">Firmware not loaded</span><br />
<strong>Progress:</strong><progress class="progress" value="0" min="0" max="100"></progress>
<strong i18n="firmwareFlasherPath"></strong><span class="path">empty</span><br />
<strong i18n="firmwareFlasherSize"></strong><span class="size">0 bytes</span><br />
<strong i18n="firmwareFlasherStatus"></strong><span class="status">Firmware not loaded</span><br />
<strong i18n="firmwareFlasherProgress"></strong><progress class="progress" value="0" min="0" max="100"></progress>
</div>
<div class="note">
<p>
If you are flashing board with <strong>baseflight</strong> already flashed (updating), leave this checkbox unchecked.<br />
If you are flashing "<strong>bare</strong>" board with no firmware preloaded or you have bootloader pins <strong>shorted</strong>, check this box.<br />
<p i18n="firmwareFlasherNote">
</p>
<label><input class="updating" type="checkbox" /><span style="font-weight: bold; margin-left: 6px;">No reboot sequence</span></label><br />
<label class="flash_on_connect_wrapper"><input class="flash_on_connect" type="checkbox" /><span style="font-weight: bold; margin-left: 6px;">Flash on connect</span><br /></label>
<label><input class="erase_chip" type="checkbox" /><span style="font-weight: bold; margin-left: 6px;">Full Chip Erase</span></label><br />
<label>
<input class="updating" type="checkbox" />
<span style="font-weight: bold; margin-left: 6px" i18n="firmwareFlasherNoReboot"></span>
</label><br />
<label class="flash_on_connect_wrapper">
<input class="flash_on_connect" type="checkbox" />
<span style="font-weight: bold; margin-left: 6px" i18n="firmwareFlasherFlashOnConnect"></span><br />
</label>
<label>
<input class="erase_chip" type="checkbox" />
<span style="font-weight: bold; margin-left: 6px" i18n="firmwareFlasherFullChipErase"></span>
</label><br />
</div>
<div class="clear-both"></div>
<div class="buttons">
<a class="load_file" href="#">Load Firmware [Local]</a>
<a class="load_remote_file" href="#">Load Firmware [Online]</a>
<a class="flash_firmware locked" href="#">Flash Firmware</a>
<a class="load_file" href="#" i18n="firmwareFlasherButtonLoadLocal"></a>
<a class="load_remote_file" href="#" i18n="firmwareFlasherButtonLoadOnline"></a>
<a class="flash_firmware locked" href="#" i18n="firmwareFlasherFlashFirmware"></a>
<div class="clear-both"></div>
</div>
<div class="git_info">
<div class="title">Github Firmware Info</div>
<div class="title" i18n="firmwareFlasherGithubInfoHead"></div>
<p>
<strong>Committer:</strong> <span class="committer"></span><br />
<strong>Date:</strong> <span class="date"></span><br />
<strong>Message:</strong> <span class="message"></span>
<strong i18n="firmwareFlasherCommiter"></strong> <span class="committer"></span><br />
<strong i18n="firmwareFlasherDate"></strong> <span class="date"></span><br />
<strong i18n="firmwareFlasherMessage"></strong> <span class="message"></span>
</p>
</div>
<div class="warning">
<div class="title">Warning</div>
<p>
Please do not try to flash <strong>non-baseflight</strong> hardware with this firmware flasher (it wont work).<br />
Do not <strong>disconnect</strong> the board or <strong>turn off</strong> your computer while flashing.<br />
<br />
Note: <strong>STM32</strong> bootloader is stored in <strong>ROM</strong>, it cannot be bricked.<br />
Note: <strong>Auto-Connect</strong> is always disabled while you are inside firmware flasher.<br />
<div class="title" i18n="firmwareFlasherWarninghead"></div>
<p i18n="firmwareFlasherWarningText">
</p>
</div>
<a class="back" href="#">Leave Firmware Flasher</a>
<a class="back" href="#" i18n="firmwareFlasherButtonLeave"></a>
</div>

View file

@ -46,12 +46,12 @@ function tab_initialize_firmware_flasher() {
parsed_hex = data;
if (parsed_hex) {
STM32.GUI_status('<span style="color: green">Firmware loaded, ready for flashing</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherFirmwareLoaded'));
$('a.flash_firmware').removeClass('locked');
$('span.size').html(parsed_hex.bytes_total + ' bytes');
} else {
STM32.GUI_status('<span style="color: red">HEX file appears to be corrupted</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}
@ -71,17 +71,17 @@ function tab_initialize_firmware_flasher() {
parsed_hex = data;
if (parsed_hex) {
STM32.GUI_status('<span style="color: green">Remote Firmware loaded, ready for flashing</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherRemoteFirmwareLoaded'));
$('a.flash_firmware').removeClass('locked');
$('span.path').html('Using remote Firmware');
$('span.size').html(parsed_hex.bytes_total + ' bytes');
$('span.path').text('Using remote Firmware');
$('span.size').text(parsed_hex.bytes_total + ' bytes');
} else {
STM32.GUI_status('<span style="color: red">HEX file appears to be corrupted</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}).fail(function() {
STM32.GUI_status('<span style="color: red">Failed to load remote firmware</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
$('a.flash_firmware').addClass('locked');
});
@ -91,9 +91,9 @@ function tab_initialize_firmware_flasher() {
var date = ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate() + 1)).slice(-2) + '.' + d.getFullYear();
date += ' @ ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);
$('div.git_info .committer').html(data.commit.author.name);
$('div.git_info .date').html(date);
$('div.git_info .message').html(data.commit.message);
$('div.git_info .committer').text(data.commit.author.name);
$('div.git_info .date').text(date);
$('div.git_info .message').text(data.commit.message);
$('div.git_info').slideDown();
});
@ -105,7 +105,7 @@ function tab_initialize_firmware_flasher() {
if (parsed_hex != false) {
STM32.connect(parsed_hex);
} else {
STM32.GUI_status('<span style="color: red">Firmware not loaded</span>');
STM32.GUI_status(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
}
}
}
@ -289,7 +289,7 @@ function tab_initialize_firmware_flasher() {
tab_initialize_default();
});
} else {
GUI.log('You <span style="color: red">can\'t</span> do this right now, please wait for current operation to finish ...');
GUI.log(chrome.i18n.getMessage('firmwareFlasherWaitForFinish'));
}
});
});