chore: 修正部分代码bug
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s

- ProductView中faqs命名错误,修正为ProductQuestionView
- 移除useLocalizations中弃置的Strapi语言获取方法
This commit is contained in:
2025-11-06 16:56:42 +08:00
parent a328414b4e
commit 6a3493c7e1
2 changed files with 1 additions and 8 deletions

View File

@ -1,4 +1,3 @@
import type { StrapiLocale } from '@nuxtjs/strapi';
import type { Language as ElementLanguage } from 'element-plus/es/locale';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import en from 'element-plus/es/locale/lang/en';
@ -8,8 +7,6 @@ import en from 'element-plus/es/locale/lang/en';
* 用于统一 Strapi / Directus / Element Plus 的多语言配置
*/
export interface LocaleMapping {
/** 用于StrapiLocale **/
strapi: StrapiLocale;
/** 用于Directus translations.languages_code **/
directus: string;
/** Element Plus语言对象 **/
@ -24,12 +21,10 @@ export interface LocaleMapping {
*/
export const localeMap = {
zh: {
strapi: 'zh-CN',
directus: 'zh-CN',
element: zhCn,
},
en: {
strapi: 'en',
directus: 'en-US',
element: en,
},
@ -74,8 +69,6 @@ export const useLocalizations = () => {
return {
/** 当前Nuxt I18n语言(只读) **/
locale: readonly(locale),
/** 获取Strapi的本地化代码 **/
getStrapiLocale: (l?: AppLocale) => getMapping(l).strapi,
/** 获取Directus的本地化代码 **/
getDirectusLocale: (l?: AppLocale) => getMapping(l).directus,
/** 获取Element Plus语言对象 **/