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

pre-enable i18n for all html content in tabs

This commit is contained in:
cTn 2014-05-06 16:48:46 +02:00
parent 6a33801463
commit 2162a2b9d3
10 changed files with 30 additions and 0 deletions

View file

@ -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>';

View file

@ -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

View file

@ -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) {

View file

@ -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);
} }

View file

@ -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

View file

@ -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();

View file

@ -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]);

View file

@ -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));

View file

@ -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();

View file

@ -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();