Merged in feat/sw3370-move-phone-utils (pull request #2743)
feat(SW-3370): Move phone utils to common * Move phone utils to common * Update lock file Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { ApiLang } from "@scandic-hotels/trpc/constants/apiLang"
|
||||
|
||||
import type { CountryCode } from "libphonenumber-js"
|
||||
|
||||
export const languages: Record<Lang, string> = {
|
||||
[Lang.da]: "Dansk",
|
||||
[Lang.de]: "Deutsch",
|
||||
@@ -81,15 +79,3 @@ export function getLocalizedLanguageOptions(currentLang: Lang) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getDefaultCountryFromLang(lang: Lang): Lowercase<CountryCode> {
|
||||
const countryMap: Record<Lang, Lowercase<CountryCode>> = {
|
||||
sv: "se",
|
||||
da: "dk",
|
||||
fi: "fi",
|
||||
no: "no",
|
||||
de: "de",
|
||||
en: "se", // Default to Sweden for English
|
||||
}
|
||||
return countryMap[lang] || "se"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user