mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
pre-enable i18n for all html content in tabs
This commit is contained in:
parent
6a33801463
commit
2162a2b9d3
10 changed files with 30 additions and 0 deletions
|
@ -13,6 +13,9 @@ function tab_initialize_auxiliary_configuration() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
function box_check(num, pos) {
|
function box_check(num, pos) {
|
||||||
if (bit_check(num, pos)) { // 1
|
if (bit_check(num, pos)) { // 1
|
||||||
return '<td><input type="checkbox" checked="checked" /></td>';
|
return '<td><input type="checkbox" checked="checked" /></td>';
|
||||||
|
|
|
@ -29,6 +29,9 @@ function tab_initialize_cli() {
|
||||||
MSP.callbacks_cleanup();
|
MSP.callbacks_cleanup();
|
||||||
|
|
||||||
$('#content').load("./tabs/cli.html", function() {
|
$('#content').load("./tabs/cli.html", function() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
CLI_active = true;
|
CLI_active = true;
|
||||||
|
|
||||||
// Enter CLI mode
|
// Enter CLI mode
|
||||||
|
|
|
@ -6,6 +6,9 @@ function tab_initialize_firmware_flasher() {
|
||||||
var parsed_hex = false; // parsed raw hex in array format
|
var parsed_hex = false; // parsed raw hex in array format
|
||||||
|
|
||||||
$('#content').load("./tabs/firmware_flasher.html", function() {
|
$('#content').load("./tabs/firmware_flasher.html", function() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
// UI Hooks
|
// UI Hooks
|
||||||
$('a.load_file').click(function() {
|
$('a.load_file').click(function() {
|
||||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['hex']}]}, function(fileEntry) {
|
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['hex']}]}, function(fileEntry) {
|
||||||
|
|
|
@ -9,6 +9,9 @@ function tab_initialize_gps () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
function get_raw_gps_data() {
|
function get_raw_gps_data() {
|
||||||
send_message(MSP_codes.MSP_RAW_GPS, false, false, get_gpsvinfo_data);
|
send_message(MSP_codes.MSP_RAW_GPS, false, false, get_gpsvinfo_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,9 @@ function tab_initialize_initial_setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
var yaw_fix = 0.0;
|
var yaw_fix = 0.0;
|
||||||
|
|
||||||
// Fill in misc stuff
|
// Fill in misc stuff
|
||||||
|
|
|
@ -13,6 +13,9 @@ function tab_initialize_motor_outputs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
// if CAP_DYNBALANCE is true
|
// if CAP_DYNBALANCE is true
|
||||||
if (bit_check(CONFIG.capability, 2)) {
|
if (bit_check(CONFIG.capability, 2)) {
|
||||||
$('div.motor_testing').show();
|
$('div.motor_testing').show();
|
||||||
|
|
|
@ -22,6 +22,9 @@ function tab_initialize_pid_tuning() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
// Fill in the names from PID_names array
|
// Fill in the names from PID_names array
|
||||||
// this needs to be reworked, but will do for now
|
// this needs to be reworked, but will do for now
|
||||||
$('.pid_tuning tr:eq(1) td:first').text(PID_names[0]);
|
$('.pid_tuning tr:eq(1) td:first').text(PID_names[0]);
|
||||||
|
|
|
@ -13,6 +13,9 @@ function tab_initialize_receiver() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
// fill in data from RC_tuning
|
// fill in data from RC_tuning
|
||||||
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
|
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
|
||||||
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));
|
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));
|
||||||
|
|
|
@ -165,6 +165,9 @@ function tab_initialize_sensors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#content').load("./tabs/sensors.html", function load_html() {
|
$('#content').load("./tabs/sensors.html", function load_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
$('.tab-sensors .info .checkboxes input').change(function() {
|
$('.tab-sensors .info .checkboxes input').change(function() {
|
||||||
var enable = $(this).prop('checked');
|
var enable = $(this).prop('checked');
|
||||||
var index = $(this).parent().index();
|
var index = $(this).parent().index();
|
||||||
|
|
|
@ -24,6 +24,9 @@ function tab_initialize_servos() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
function process_directions(name, obj, bitpos) {
|
function process_directions(name, obj, bitpos) {
|
||||||
$('div.direction_wrapper').show();
|
$('div.direction_wrapper').show();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue