Skip to content

Commit

Permalink
chore: updated default locale
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga committed Dec 20, 2024
1 parent 28d92d0 commit 59962df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/dates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import localeInfo, { LocaleInfo, Locales } from "./locale-info";

export function localeDefault(locale?: string) {
if (locale) return locale;
if (typeof navigator !== "undefined") return navigator.language;
if (typeof navigator !== "undefined" && navigator.language) return navigator.language;
return "en-US";
}

Expand Down
1 change: 1 addition & 0 deletions src/components/ebay-phone-input/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class PhoneInput extends Marko.Component<Input, State> {
onInput(input: Input) {
const { countryCode } = input;
let locale = localeDefault(input.locale);
console.log(input.locale, locale);
if (locale !== this.locale) {
this.locale = locale;
const getName = new Intl.DisplayNames([locale], { type: "region" });
Expand Down

0 comments on commit 59962df

Please sign in to comment.