Skip to content

Commit

Permalink
fix(methods): fallback to default language
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Dec 8, 2022
1 parent 9ab30de commit 6655207
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Ref } from 'vue'

import { useCookieControl } from './composables'
import { LOCALE_DEFAULT } from './constants'
import { Cookie, Locale, ModuleOptions, Translatable } from './types'
import { Cookie, ModuleOptions, Translatable } from './types'

export const useAcceptNecessary = () => {
const { cookiesEnabled, isConsentGiven, moduleOptions } = useCookieControl()
Expand Down Expand Up @@ -51,7 +51,10 @@ export const useResolveTranslatable = (locale = LOCALE_DEFAULT) => {
resolveTranslatable(translatable, locale)
}

const resolveTranslatable = (translatable: Translatable, locale?: Locale) => {
const resolveTranslatable = (
translatable: Translatable,
locale = LOCALE_DEFAULT
) => {
if (typeof translatable === 'string') return translatable

if (!locale)
Expand Down

0 comments on commit 6655207

Please sign in to comment.