File tree Expand file tree Collapse file tree 8 files changed +11
-11
lines changed Expand file tree Collapse file tree 8 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 88 const env = {
99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
11- browser : { displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) }
11+ browser : { displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) }
1212 }
1313
1414 // Import DATA
Original file line number Diff line number Diff line change 88 const env = {
99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
11- browser : { displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) }
11+ browser : { displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) }
1212 }
1313
1414 // Import DATA
Original file line number Diff line number Diff line change 4040 . filter ( key => key != 'infinityMode' ) ) // exclude infinityMode...
4141 settings . save ( 'infinityMode' , false ) // ...to always init as false
4242 if ( ! config . replyLanguage ) // init reply language if unset
43- settings . save ( 'replyLanguage' , ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] )
43+ settings . save ( 'replyLanguage' , chrome . i18n . getUILanguage ( ) )
4444 if ( ! config . replyTopic ) // init reply topic if unset
4545 settings . save ( 'replyTopic' , getMsg ( 'menuLabel_all' ) )
4646 if ( ! config . replyInterval ) settings . save ( 'replyInterval' , 7 ) // init refresh interval to 7 secs if unset
Original file line number Diff line number Diff line change 88 const env = {
99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
11- browser : { displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) }
11+ browser : { displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) }
1212 }
1313
1414 // Import APP data
107107 }
108108
109109 // Add listener
110- entry . div . onclick = async ( ) => {
110+ entry . div . onclick = ( ) => {
111111 if ( controlType == 'toggle' ) {
112112 entry . leftElem . classList . toggle ( 'on' )
113113 settings . save ( key , ! config [ key ] ) ; sync . configToUI ( { updatedKey : key } )
122122 replyLang = ( // auto-case for menu/alert aesthetics
123123 replyLang . length < 4 || replyLang . includes ( '-' ) ? replyLang . toUpperCase ( )
124124 : replyLang . charAt ( 0 ) . toUpperCase ( ) + replyLang . slice ( 1 ) . toLowerCase ( ) )
125- settings . save ( 'replyLanguage' , replyLang || ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] )
125+ settings . save ( 'replyLanguage' , replyLang || chrome . i18n . getUILanguage ( ) )
126126 siteAlert ( getMsg ( 'alert_replyLangUpdated' ) + '!' ,
127127 `${ getMsg ( 'appName' ) } ${ getMsg ( 'alert_willReplyIn' ) } `
128128 + `${ replyLang || getMsg ( 'alert_yourSysLang' ) } .`
Original file line number Diff line number Diff line change 4343 . filter ( key => key != 'infinityMode' ) ) // exclude infinityMode...
4444 settings . save ( 'infinityMode' , false ) // ...to always init as false
4545 if ( ! config . replyLanguage ) // init reply language if unset
46- settings . save ( 'replyLanguage' , ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] )
46+ settings . save ( 'replyLanguage' , chrome . i18n . getUILanguage ( ) )
4747 if ( ! config . replyTopic ) // init reply topic if unset
4848 settings . save ( 'replyTopic' , getMsg ( 'menuLabel_all' ) )
4949 if ( ! config . replyInterval ) settings . save ( 'replyInterval' , 7 ) // init refresh interval to 7 secs if unset
Original file line number Diff line number Diff line change 88 const env = {
99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
11- browser : { displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) }
11+ browser : { displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) }
1212 }
1313
1414 // Import APP data
123123 replyLang = ( // auto-case for menu/alert aesthetics
124124 replyLang . length < 4 || replyLang . includes ( '-' ) ? replyLang . toUpperCase ( )
125125 : replyLang . charAt ( 0 ) . toUpperCase ( ) + replyLang . slice ( 1 ) . toLowerCase ( ) )
126- settings . save ( 'replyLanguage' , replyLang || ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] )
126+ settings . save ( 'replyLanguage' , replyLang || chrome . i18n . getUILanguage ( ) )
127127 siteAlert ( getMsg ( 'alert_replyLangUpdated' ) + '!' ,
128128 `${ getMsg ( 'appName' ) } ${ getMsg ( 'alert_willReplyIn' ) } `
129129 + `${ replyLang || getMsg ( 'alert_yourSysLang' ) } .`
Original file line number Diff line number Diff line change 99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
1111 browser : {
12- displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) ,
12+ displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) ,
1313 isFF : navigator . userAgent . includes ( 'Firefox' )
1414 }
1515 }
Original file line number Diff line number Diff line change 99 site : / ( [ ^ . ] + ) \. [ ^ . ] + $ / . exec ( new URL ( ( await chrome . tabs . query (
1010 { active : true , currentWindow : true } ) ) [ 0 ] . url ) . hostname ) ?. [ 1 ] ,
1111 browser : {
12- displaysEnglish : ( await chrome . i18n . getAcceptLanguages ( ) ) [ 0 ] . startsWith ( 'en' ) ,
12+ displaysEnglish : chrome . i18n . getUILanguage ( ) . startsWith ( 'en' ) ,
1313 isFF : navigator . userAgent . includes ( 'Firefox' )
1414 }
1515 }
You can’t perform that action at this time.
0 commit comments