alloyui scheduler组件如何本地化?

How to localize the alloyui scheduler component?

我正在尝试将 alloyui 调度程序完全本地化为法语。 关注这篇文章:How can I get a localized version of a YUI 3 or AlloyUI component? 工作即将完成。 但是我仍然缺少两件事的提示: - 我需要将左栏中的时间格式从 1-12am/pm 更改为 1-24 - 我没有成功地定位左上角的 "All day" 术语(或者至少是一种隐藏它的方法)。

欢迎任何帮助

要更改为 24 小时制,您需要将您正在使用的每个 SchedulerView 子类的 isoTime attribute 设置为 true

要国际化字符串,您需要设置 Scheduler, SchedulerDayView SchedulerWeekView, SchedulerMonthView, SchedulerAgendaView, and SchedulerEventRecorder as well as setting YUI's lang attribute to the locale of your choice. For example, I've used Google Translate* 的 strings 属性,以便为西班牙用户国际化下面的 Scheduler

YUI({lang: 'es-ES'}).use('aui-scheduler', function (Y) {
    var es_ES_strings_allDay = { allDay: 'todo el dia' };
    new Y.Scheduler({
        render: true,
        // https://alloyui.com/api/classes/A.Scheduler.html#attr_strings
        // https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-base.js#L606-L622
        strings: {
            agenda: 'agenda',
            day: 'día',
            month: 'mes',
            today: 'hoy',
            week: 'semana',
            year: 'año'
        },
        views: [
            // https://alloyui.com/api/classes/A.SchedulerDayView.html#attr_strings
            // https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-view-day.js#L363-L373
            new Y.SchedulerDayView({
                isoTime: true,
                strings: es_ES_strings_allDay
            }),
            // https://alloyui.com/api/classes/A.SchedulerWeekView.html#attr_strings
            // SchedulerWeekView extends SchedulerDayView: https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-view-week.js#L19
            new Y.SchedulerWeekView({
                isoTime: true,
                strings: es_ES_strings_allDay
            }),
            // https://alloyui.com/api/classes/A.SchedulerMonthView.html#attr_strings
            // https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-view-week.js#L19
            new Y.SchedulerMonthView({
                isoTime: true,
                strings: {
                    showMore: 'mostrar {0} más',
                    close: 'cerrar'
                }
            }),
            // https://alloyui.com/api/classes/A.SchedulerAgendaView.html#attr_strings
            // https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-view-week.js#L19
            new Y.SchedulerAgendaView({
                isoTime: true,
                strings: {
                    noEvents: 'No hay eventos futuros'
                }
            })
        ],
        // https://alloyui.com/api/classes/A.SchedulerEventRecorder.html#attr_strings
        // https://github.com/liferay/alloy-ui/blob/3.0.3-deprecated.65/src/aui-scheduler/js/aui-scheduler-view-week.js#L19
        eventRecorder: new Y.SchedulerEventRecorder({
            strings: {
                'delete': 'borrar',
                'description-hint': 'descripción insinuación',
                cancel: 'cancelar',
                description: 'descripción',
                edit: 'editar',
                save: 'salvar',
                when: 'cuando'
            }
        })
    });
});

* 我不建议使用 Google 翻译来国际化生产应用程序,因为机器翻译会遗漏国际化的许多细微差别。