vue.js - 如何在 Vue.js 中获得 fullCalendar 的完整翻译
问题描述
我的 Vue 应用程序中有 Fullcalendar 并将语言设置为“da”,但它并不能翻译所有内容。
角落里的“今天”按钮没有翻译,但其他所有内容都翻译了。
我试图导入语言环境文件。all 和“da”。
import daLocale from '@fullcalendar/core/locales/da'
import allLocales from '@fullcalendar/core/locales-all'
我也尝试将“allLocales”直接放在<fullCalender>
标签上
<FullCalendar
class="demo-app-calendar"
ref="fullCalendar"
defaultView="dayGridMonth"
:plugins="calendarPlugins"
:events="calendarEvents"
locale="da"
:locales="allLocales"
/>
我已经尝试将 CDN 设置为<head>
<script src='fullcalendar/core/locales-all.js'></script>
<script src='fullcalendar/core/locales/da.js'></script>
我已经阅读了文档中的所有内容,并且在有关语言环境的文档中,它没有显示如何在 Vue.js DOCS中进行操作
我应该做任何其他设置来获得完整的翻译吗?
解决方案
这是我的答案。
import FullCalendar from "@fullcalendar/vue";
import esLocale from "@fullcalendar/core/locales/es";
... ...
data() {
return {
calendarOptions: {
plugins: [dayGridPlugin, interactionPlugin],
initialView: "dayGridMonth",
locale: esLocale,
headerToolbar: {
left: "title",
right: "today dayGridWeek dayGridMonth",
},
},
};
}
... ...
<FullCalendar
ref="fullcalendar"
:options="calendarOptions"
/>
推荐阅读
- postgresql - 我如何确定哪些查询返回的数据最多?(PostgreSQL、Dotnet Core EF)
- crystal-reports - 创建 CrystalDecisions.CrystalReports.Engine.ReportDocument 的对象时应用程序崩溃
- javascript - React 类组件上的 OnChange 和 React 函数组件上的等价代码是什么
- jenkins - 詹金斯 - 没有方法签名:java.lang.String.getResult()
- python - scrapy 没有将计算的列表作为起始 url,但可以正常使用文本 url
- ruby-on-rails - Sidekiq / Ruby On Rails - 使用 Redis (Redlock) 锁定未正确锁定
- python - 无法使用 pynput 移动我的世界角色
- python - 从一个文件到另一个文件的选择性写入
- asp.net - 在 Linux 服务器上监控来自 ASP.NET 的 HTTP 响应/请求大小
- python - 将RGB分配给投影点python