File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,11 @@ export default Base.extend({
109109 await import ( "select2" ) ;
110110 try {
111111 // Don't load "en" which is the default where no separate language file exists.
112- if ( this . options . language && this . options . language !== "en" ) {
113- await import ( `select2/select2_locale_${ this . options . language } ` ) ;
112+ if ( this . options . language && this . options . language !== "en" && ! this . options . language . startsWith ( "en" ) ) {
113+ let lang = this . options . language . split ( "-" ) ;
114+ // Fix for country specific languages
115+ lang = ( lang . length > 1 ) ? `${ lang [ 0 ] } -${ lang [ 1 ] } ` : lang [ 0 ] ;
116+ await import ( `select2/select2_locale_${ lang } ` ) ;
114117 }
115118 } catch {
116119 console . warn ( "Language file could not be loaded" , this . options . language ) ;
You can’t perform that action at this time.
0 commit comments