Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mode Tab have Modes grouped in category and selections depend on Cloud build options #3583

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dedcc7f
At Auxiliaty tab, now switch to hide non FlightModes
HThuren Sep 17, 2023
6a74af7
Fix code smell
HThuren Sep 17, 2023
2e4863d
Test
HThuren Sep 20, 2023
9d1e0cc
Simplification
HThuren Sep 21, 2023
04277f6
Resolved
HThuren Oct 10, 2023
ced6a31
Resolved
HThuren Oct 10, 2023
6a3fd3f
rebase
HThuren Nov 12, 2023
ee28800
Change to category
HThuren Nov 20, 2023
6a1b8b5
BuildOptions
HThuren Nov 28, 2023
6d4a59f
BuildOptions
HThuren Nov 29, 2023
58f63ba
More build
HThuren Nov 30, 2023
4c02711
multiselect
HThuren Dec 1, 2023
9cff705
more to go
HThuren Dec 11, 2023
3d9e4c4
more to go
HThuren Dec 11, 2023
3a2e8b0
more to go
HThuren Dec 11, 2023
f855b5e
more to go
HThuren Dec 11, 2023
c52d424
unused get to work
HThuren Dec 12, 2023
8cb27a2
ready
HThuren Dec 12, 2023
33fb347
sonarcloud fix
HThuren Dec 12, 2023
f55ce01
update help text
HThuren Dec 13, 2023
9add380
update help text
HThuren Dec 13, 2023
0a3375d
update help text
HThuren Dec 13, 2023
d7283aa
fix initial load
HThuren Dec 15, 2023
f6ac8b1
code review
HThuren Dec 17, 2023
7d29159
update of CSS
HThuren Dec 19, 2023
f561436
fix quality issue
HThuren Dec 21, 2023
35d0d0d
more call of categories when initialize
HThuren Dec 26, 2023
e8e59c4
fix bugs for not update ui, when unselect mode
HThuren Feb 21, 2024
9295675
fix zero issue
HThuren Feb 21, 2024
569b4c9
Design changes
HThuren Feb 21, 2024
e8a91e5
Default list are all cat
HThuren Feb 21, 2024
f42d174
fix from review
HThuren Mar 3, 2024
db9e68c
Merge branch 'master' into hideNonFlightmode
HThuren Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@
"tabAuxiliary": {
"message": "Modes"
},

"logActionHide": {
"message": "Hide Log"
},
Expand All @@ -424,7 +423,6 @@
"serialErrorParityError": {
"message": "Serial connection error: bad parity"
},

"serialPortOpened": {
"message": "Serial port <span class=\"message-positive\">successfully</span> opened with ID: $1"
},
Expand Down Expand Up @@ -2311,7 +2309,7 @@
"message": "Enable controls"
},
"auxiliaryHelp": {
"message": "Configure modes here using a combination of ranges and/or links to other modes (links supported on BF 4.0 and later). Use <strong>ranges</strong> to define the switches on your transmitter and corresponding mode assignments. A receiver channel that gives a reading between a range min/max will activate the mode. Use a <strong>link</strong> to activate a mode when another mode is activated. <strong>Exceptions:</strong> ARM cannot be linked to or from another mode, modes cannot be linked to other modes that are configured with a link (chained links). Multiple ranges/links can be used to activate any mode. If there is more than one range/link defined for a mode, each of them can be set to <strong>AND</strong> or <strong>OR</strong>. A mode will be activated when:<br />- ALL <strong>AND</strong> ranges/links are active; OR<br />- at least one <strong>OR</strong> range/link is active.<br /><br />Remember to save your settings using the Save button."
"message": "Configure modes here using a combination of ranges and/or links to other modes. The Category arrange modes in groups, at Cloud build only groups defined in Build are enabled. At local build all groups are enabled.<br />Use <strong>ranges</strong> to define the switches on your transmitter and corresponding mode assignments. A receiver channel that gives a reading between a range min/max will activate the mode. Use a <strong>link</strong> to activate a mode when another mode is activated. Multiple ranges/links can be used to activate any mode.<br />If there is more than one range/link defined for a mode, each of them can be set to <strong>AND</strong> or <strong>OR</strong>. A mode will be activated when: ALL <strong>AND</strong> ranges/links are active; OR at least one <strong>OR</strong> range/link is active.<br /><strong>Exceptions:</strong> ARM cannot be linked to or from another mode, modes cannot be linked to other modes that are configured with a link (chained links).<br /><strong>Notice:</strong> 'Hide unused modes' need minimum one configured mode to really work.<br />Remember to save your settings using the Save button."
},
"auxiliaryToggleUnused": {
"message": "Hide unused modes"
Expand Down Expand Up @@ -2464,7 +2462,7 @@
"message": "Enable MSP Override mode",
"description": "Help text to MSP OVERRIDE mode"
},
"auxiliaryHelpMode_OSDDISABLE": {
"auxiliaryHelpMode_OSD": {
"message": "Enable/Disable On-Screen-Display",
"description": "Help text to OSD mode"
},
Expand Down Expand Up @@ -2524,7 +2522,7 @@
"message": "Use to toggle customized USER4. Controls arbitrary output via PINIO",
"description": "Help text to customized USER4 mode"
},
"auxiliaryHelpMode_VTXCONTROLDISABLE": {
"auxiliaryHelpMode_DISABLEVTXCONTROL": {
"message": "Disable the control of VTX settings through the OSD",
"description": "Help text to VTX CONTROL DISABLE mode"
},
Expand Down
7 changes: 6 additions & 1 deletion src/css/tabs/auxiliary.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
background-color: #ffcb18;
margin-bottom: 10px;
}
.toolbox {
.auxiliary_toolbox {
font-weight: bold;
padding: 1rem 0;
form {
Expand Down Expand Up @@ -230,6 +230,11 @@
}
@media all and (max-width: 575px) {
.tab-auxiliary {
.auxiliary_category {
flex-wrap: wrap;
width: 100%;
border-bottom: 0;
}
.mode {
flex-wrap: wrap;
height: fit-content;
Expand Down
22 changes: 20 additions & 2 deletions src/js/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,32 @@ const i18n = {};
window.i18n = i18n;


const languagesAvailables = ['ca', 'da', 'de', 'en', 'es', 'eu', 'fr', 'gl', 'it', 'ja', 'ko', 'nl', 'pt', 'pt_BR', 'pl', 'ru', 'uk', 'zh_CN', 'zh_TW'];
const languagesAvailables = ['ca', 'da', 'de', 'en', 'es', 'eu', 'fr', 'gl', 'it',
'ja', 'ko', 'nl', 'pt', 'pt_BR', 'pl', 'ru', 'uk', 'zh_CN', 'zh_TW'];

const languageFallback = {
'pt': ['pt_BR', 'en'],
'pt_BR': ['pt', 'en'],
'default': ['en'],
};

// must be aligned with languagesAvailables
const languageISOcode = ['ca-ES', 'da-DK', 'de-DE', 'en-US', 'es-ES', 'eu-ES', 'fr-FR', 'gl-ES', 'it-IT',
'ja-JP', 'ko-KR', 'nl-NL', 'pt-PT', 'pt-BR', 'pl-PL', 'ru-RU', 'uk-UA', 'zh-CN', 'zh-TW'];

/**
* Functions that return ISO Language Code Table from http://www.lingoes.net/en/translator/langcode.htm
* Map between languagesAvailables and languageISOcode
* Fallback to en-US
*/
function getCurrentLocaleISO() {
const isoCodeIndex = languagesAvailables.indexOf(i18next.language);
if (isoCodeIndex === -1) {
return 'en-US';
}
return languageISOcode[isoCodeIndex];
}

/**
* Functions that depend on the i18n framework
*/
Expand Down Expand Up @@ -238,4 +256,4 @@ i18n.addResources = function(bundle) {
i18next.addResourceBundle(lang, ns, bundle, true, true);
};

export { i18n };
export { i18n, getCurrentLocaleISO };
Loading