strapi V4安装设置中文面板

官网:Strapi - Open source Node.js Headless CMS 🚀

文档:Strapi Developer Docs

yarn create strapi-app my-project
//选择安装类型:
//Quickstart (recommended),它使用默认数据库 (SQLite)
//Custom (manual settings),这允许选择您的首选数据库
//启动
yarn develop

 

创建src\admin\app.js

对应文档 Admin panel customization - Strapi Developer Docs

把开启对应的语言

// path: ./my-app/src/admin/app.js

import AuthLogo from './extensions/my-logo.png';
import MenuLogo from './extensions/logo.png';
import favicon from './extensions/favicon.ico';

export default {
  config: {
    // Replace the Strapi logo in auth (login) views
    auth: {
      logo: AuthLogo,
    },
   // Replace the favicon
    head: {
      favicon: favicon,
    },
    // Add a new locale, other than 'en'
    locales: ['fr', 'de'],
    // Replace the Strapi logo in the main navigation
    menu: {
      logo: MenuLogo,
    },
    // Override or extend the theme
    theme: {
      colors: {
        primary100: '#f6ecfc',
        primary200: '#e0c1f4',
        primary500: '#ac73e6',
        primary600: '#9736e8',
        primary700: '#8312d1',
        danger700: '#b72b1a'
      },
    },
    // Extend the translations
    translations: {
      fr: {
        'Auth.form.email.label': 'test',
        Users: 'Utilisateurs',
        City: 'CITY (FRENCH)',
        // Customize the label of the Content Manager table.
        Id: 'ID french',
      },
    },
   // Disable video tutorials
    tutorials: false,
   // Disable notifications about new Strapi releases
    notifications: { release: false },
  },

  bootstrap() {},
};

 

然后进入后台 右下角的点击个人头像

Profile     ->  Experience  ->  Interface language 选择对应的选项

如果无法设置删除 项目根目录里的build和.cache文件夹

重新 yarn develop

 

posted @ 2022-05-08 18:33  羽鱼  阅读(2947)  评论(0编辑  收藏  举报