Skip to content

Commit

Permalink
chore: return boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Nov 12, 2024
1 parent 8d9b59a commit aa24dcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/client/theme-default/components/VPDocFooterLastUpdated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ const datetime = ref('')
// set time on mounted hook to avoid hydration mismatch due to
// potential differences in timezones of the server and clients
onMounted(() => {
function findBestLocaleMatch(pageLocale: string): string | undefined {
function findBestLocaleMatch(pageLocale: string) {
return navigator.languages.find((userLang) => {
if (pageLocale === userLang)
return pageLocale
return true
// Edge browser: case for ca-valencia
if (pageLocale === 'ca-valencia' && userLang === 'ca-Es-VALENCIA')
return pageLocale
return true
// add iso-639 support for Latin America
if (userLang.startsWith('es-') && userLang !== 'es-ES' && pageLocale === 'es-419')
return pageLocale
return true
return userLang.startsWith(pageLocale) ? pageLocale : undefined
return userLang.startsWith(pageLocale)
})
}
watchEffect(() => {
Expand Down

0 comments on commit aa24dcd

Please sign in to comment.