From e55c0e25947e7bcef931b26dafaad120f488a627 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 14 Nov 2024 23:53:35 +0500 Subject: [PATCH] feat(locale): typing `dir` (#2643) --- src/runtime/utils/locale.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/utils/locale.ts b/src/runtime/utils/locale.ts index 9428c046..ee80ddd8 100644 --- a/src/runtime/utils/locale.ts +++ b/src/runtime/utils/locale.ts @@ -1,5 +1,5 @@ import type { Ref } from 'vue' -import type { Locale } from '../types/locale' +import type { Locale, Direction } from '../types/locale' import type { MaybeRef } from '@vueuse/core' import { computed, isRef, ref, unref } from 'vue' import { get } from './index' @@ -9,7 +9,7 @@ export type Translator = (path: string, option?: TranslatorOption) => string export type LocaleContext = { locale: Ref lang: Ref - dir: Ref + dir: Ref code: Ref t: Translator } @@ -30,7 +30,7 @@ export function translate(path: string, option: undefined | TranslatorOption, lo export function buildLocaleContext(locale: MaybeRef): LocaleContext { const lang = computed(() => unref(locale).name) const code = computed(() => unref(locale).code) - const dir = computed(() => unref(locale).dir.toLowerCase()) + const dir = computed(() => unref(locale).dir) const localeRef = isRef(locale) ? locale : ref(locale) return {