翻译全日历 Header
Translate FullCalendar Header
我想翻译 FullCalendar header(下一个、上一个、今天...)。我已经完成了 month/days,但我在 header 方面遇到了一些问题。我没有成功设置“语言环境”。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="ui container">
<div class="ui grid">
<div class="ui sixteen column">
<div id="calendar"></div>
</div>
</div>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js'></script>
$(document).ready(function() {
$('#calendar').fullCalendar({
monthNames: ['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Dedembre'],
monthNamesShort: ['Janv', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Jul', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec'],
dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
header: {
left: 'prev, next, today',
center: 'title',
right: 'month, basicWeek, basicDay'
},
defaultDate: '<?= json_encode(date("Y-m-d"), \JSON_HEX_TAG) ?>',
navLinks: true,
editable: true,
eventLimit: true,
events: <?= json_encode($events, \JSON_HEX_TAG) ?>
});
})();
您可以使用 buttonText
选项为按钮添加翻译:
buttonText: {
today: 'hellow',
day: 'world',
week:'welcome',
month:'hmmm'
},
按钮文字
将显示在 headerToolbar/footerToolbar.
按钮上的文本
{
today: 'today',
month: 'month',
week: 'week',
day: 'day',
list: 'list'
}
我想翻译 FullCalendar header(下一个、上一个、今天...)。我已经完成了 month/days,但我在 header 方面遇到了一些问题。我没有成功设置“语言环境”。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="ui container">
<div class="ui grid">
<div class="ui sixteen column">
<div id="calendar"></div>
</div>
</div>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js'></script>
$(document).ready(function() {
$('#calendar').fullCalendar({
monthNames: ['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Dedembre'],
monthNamesShort: ['Janv', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Jul', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec'],
dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
header: {
left: 'prev, next, today',
center: 'title',
right: 'month, basicWeek, basicDay'
},
defaultDate: '<?= json_encode(date("Y-m-d"), \JSON_HEX_TAG) ?>',
navLinks: true,
editable: true,
eventLimit: true,
events: <?= json_encode($events, \JSON_HEX_TAG) ?>
});
})();
您可以使用 buttonText
选项为按钮添加翻译:
buttonText: {
today: 'hellow',
day: 'world',
week:'welcome',
month:'hmmm'
},
按钮文字
将显示在 headerToolbar/footerToolbar.
{
today: 'today',
month: 'month',
week: 'week',
day: 'day',
list: 'list'
}