chore: 修复部分代码bug #62
@ -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语言对象 **/
|
||||
|
||||
@ -31,7 +31,7 @@ export interface ProductView {
|
||||
specs: ProductSpecGroupView[];
|
||||
|
||||
/** 产品常见问题 **/
|
||||
faqs: QuestionView[];
|
||||
faqs: ProductQuestionView[];
|
||||
|
||||
/** 产品文档 **/
|
||||
documents: ProductDocumentView[];
|
||||
|
||||
Reference in New Issue
Block a user