Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
akless committed Apr 23, 2024
1 parent 2108f32 commit ebc233f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions lang/ccm.lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @license The MIT License (MIT)
* @version latest (1.2.0)
* @changes
* version 1.2.0 (23.04.2024): support for dataset translation
* version 1.2.0 (23.04.2024): support for dataset translation, detect initial language from URL parameter
* version 1.1.0 (11.02.2022): controllable dark mode
* version 1.0.0 (29.12.2021)
*/
Expand Down Expand Up @@ -55,6 +55,7 @@
if ( context )
this.active = context.active; // detect from highest instance
else {
if ( !this.active ) this.active = this.helper.params().lang; // detect from URL parameter
if ( !this.active ) this.active = document.body.getAttribute( 'lang' ); // detect from <body lang="">
if ( !this.active ) this.active = navigator.language; // detect from browser
this.active = this.active.split( '-' )[ 0 ].toLowerCase();
Expand Down Expand Up @@ -91,7 +92,7 @@
*/
this.start = async () => {

// not highest instance? => remove root element
// not the highest instance? => remove root element
if ( context ) { this.element.innerHTML = ''; return; }

// render language selection
Expand Down
2 changes: 1 addition & 1 deletion lang/ccm.lang.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lang/ccm.lang.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lang/versions/ccm.lang-1.2.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @license The MIT License (MIT)
* @version 1.2.0
* @changes
* version 1.2.0 (23.04.2024): support for dataset translation
* version 1.2.0 (23.04.2024): support for dataset translation, detect initial language from URL parameter
* version 1.1.0 (11.02.2022): controllable dark mode
* version 1.0.0 (29.12.2021)
*/
Expand Down Expand Up @@ -56,6 +56,7 @@
if ( context )
this.active = context.active; // detect from highest instance
else {
if ( !this.active ) this.active = this.helper.params().lang; // detect from URL parameter
if ( !this.active ) this.active = document.body.getAttribute( 'lang' ); // detect from <body lang="">
if ( !this.active ) this.active = navigator.language; // detect from browser
this.active = this.active.split( '-' )[ 0 ].toLowerCase();
Expand Down Expand Up @@ -92,7 +93,7 @@
*/
this.start = async () => {

// not highest instance? => remove root element
// not the highest instance? => remove root element
if ( context ) { this.element.innerHTML = ''; return; }

// render language selection
Expand Down
Loading

0 comments on commit ebc233f

Please sign in to comment.