Skip to content

Commit

Permalink
fix(pat select2): add improvements from review
Browse files Browse the repository at this point in the history
  • Loading branch information
1letter committed Feb 14, 2025
1 parent f2631a7 commit 84a5a1f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/pat/select2/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,9 @@ export default Base.extend({
try {
// Don't load "en" which is the default where no separate language file exists.
if (this.options.language && this.options.language !== "en" && !this.options.language.startsWith("en")) {
var lang = this.options.language;
let lang = this.options.language.split("-");
// Fix for country specific languages
if (lang.split("-").length > 1) {
lang =
lang.split("-")[0] +
"-" +
lang.split("-")[1].toUpperCase();
}
lang = (lang.length > 1) ? `${lang[0]}-${lang[1]}` : lang[0];
await import(`select2/select2_locale_${lang}`);
}
} catch {
Expand Down

0 comments on commit 84a5a1f

Please sign in to comment.