@@ -1830,16 +1830,16 @@ OSD.constants = {
1830
1830
1831
1831
} ,
1832
1832
FONT_TYPES : [
1833
- { file : "default" , name : "Default " } ,
1834
- { file : "bold" , name : "Bold " } ,
1835
- { file : "large" , name : "Large " } ,
1836
- { file : "extra_large" , name : "Extra Large " } ,
1837
- { file : "betaflight" , name : "Betaflight " } ,
1838
- { file : "digital" , name : "Digital " } ,
1839
- { file : "clarity" , name : "Clarity " } ,
1840
- { file : "vision" , name : "Vision " } ,
1841
- { file : "impact" , name : "Impact " } ,
1842
- { file : "impact_mini" , name : "Impact Mini " } ,
1833
+ { file : "default" , name : "osdSetupFontTypeDefault " } ,
1834
+ { file : "bold" , name : "osdSetupFontTypeBold " } ,
1835
+ { file : "large" , name : "osdSetupFontTypeLarge " } ,
1836
+ { file : "extra_large" , name : "osdSetupFontTypeLargeExtra " } ,
1837
+ { file : "betaflight" , name : "osdSetupFontTypeBetaflight " } ,
1838
+ { file : "digital" , name : "osdSetupFontTypeDigital " } ,
1839
+ { file : "clarity" , name : "osdSetupFontTypeClarity " } ,
1840
+ { file : "vision" , name : "osdSetupFontTypeVision " } ,
1841
+ { file : "impact" , name : "osdSetupFontTypeImpact " } ,
1842
+ { file : "impact_mini" , name : "osdSetupFontTypeImpactMini " } ,
1843
1843
] ,
1844
1844
} ;
1845
1845
@@ -2666,11 +2666,14 @@ osd.initialize = function(callback) {
2666
2666
const option = $ ( '<option>' , {
2667
2667
"data-font-file" : e . file ,
2668
2668
value : e . file ,
2669
- text : e . name ,
2669
+ text : i18n . getMessage ( e . name ) ,
2670
2670
} ) ;
2671
2671
fontPresetsElement . append ( $ ( option ) ) ;
2672
2672
} ) ;
2673
2673
2674
+ // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
2675
+ fontPresetsElement . sortSelect ( i18n . getMessage ( "osdSetupFontTypeDefault" ) ) ;
2676
+
2674
2677
const fontbuttons = $ ( '.fontpresets_wrapper' ) ;
2675
2678
fontbuttons . append ( $ ( '<button>' , { class : "load_font_file" , i18n : "osdSetupOpenFont" } ) ) ;
2676
2679
@@ -3040,10 +3043,12 @@ osd.initialize = function(callback) {
3040
3043
3041
3044
// Standard fonts
3042
3045
OSD . constants . FONT_TYPES . forEach ( function ( e ) {
3043
- const optionText = i18n . getMessage ( 'osdSetupPreviewSelectFontElement' , { fontName : e . name } ) ;
3044
- osdFontSelectorElement . append ( new Option ( optionText , e . file ) ) ;
3046
+ osdFontSelectorElement . append ( new Option ( i18n . getMessage ( e . name ) , e . file ) ) ;
3045
3047
} ) ;
3046
3048
3049
+ // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
3050
+ osdFontSelectorElement . sortSelect ( i18n . getMessage ( "osdSetupFontTypeDefault" ) ) ;
3051
+
3047
3052
osdFontSelectorElement . change ( function ( ) {
3048
3053
// Change the font selected in the Font Manager, in this way it is easier to flash if the user likes it
3049
3054
osdFontPresetsSelectorElement . val ( this . value ) . change ( ) ;
0 commit comments