from plone.formwidget.recurrence import pfr_message, pl_message
from zope.i18n import translate


def translations(request):
    translation_table = dict(
        displayUnactivate=translate(pfr_message(u'display_unactivate'), context=request),
        displayActivate=translate(pfr_message(u'display_activate'), context=request),
        add_rules=translate(pfr_message(u'add_rules'), context=request),
        edit_rules=translate(pfr_message(u'edit_rules'), context=request),
        delete_rules=translate(pfr_message(u'delete_rules'), context=request),
        add=translate(pfr_message(u'add'), context=request),
        refresh=translate(pfr_message(u'refresh'), context=request),
        title=translate(pfr_message(u'title'), context=request),
        preview=translate(pfr_message(u'preview'), context=request),
        addDate=translate(pfr_message(u'add_date'), context=request),
        recurrenceType=translate(pfr_message(u'recurrence_type'), context=request),
        dailyInterval1=translate(pfr_message(u'daily_interval_1'), context=request),
        dailyInterval2=translate(pfr_message(u'daily_interval_2'), context=request),
        weeklyInterval1=translate(pfr_message(u'weekly_interval_1'), context=request),
        weeklyInterval2=translate(pfr_message(u'weekly_interval_2'), context=request),
        weeklyWeekdays=translate(pfr_message(u'weekly_weekdays'), context=request),
        weeklyWeekdaysHuman=translate(pfr_message(u'weekly_weekdays_human'), context=request),
        monthlyInterval1=translate(pfr_message(u'monthly_interval_1'), context=request),
        monthlyInterval2=translate(pfr_message(u'monthly_interval_2'), context=request),
        monthlyDayOfMonth1=translate(pfr_message(u'monthly_day_of_month_1'), context=request),
        monthlyDayOfMonth1Human=translate(pfr_message(u'monthly_day_of_month_1_human'), context=request),
        monthlyDayOfMonth2=translate(pfr_message(u'monthly_day_of_month_2'), context=request),
        monthlyDayOfMonth3=translate(pfr_message(u'monthly_day_of_month_3'), context=request),
        monthlyDayOfMonth4=translate(pfr_message(u'monthly_day_of_month_4'), context=request),
        monthlyWeekdayOfMonth1=translate(pfr_message(u'monthly_weekday_of_month_1'), context=request),
        monthlyWeekdayOfMonth1Human=translate(pfr_message(u'monthly_weekday_of_month_1_human'), context=request),
        monthlyWeekdayOfMonth2=translate(pfr_message(u'monthly_weekday_of_month_2'), context=request),
        monthlyWeekdayOfMonth3=translate(pfr_message(u'monthly_weekday_of_month_3'), context=request),
        monthlyRepeatOn=translate(pfr_message(u'monthly_repeat_on'), context=request),
        yearlyInterval1=translate(pfr_message(u'yearly_interval_1'), context=request),
        yearlyInterval2=translate(pfr_message(u'yearly_interval_2'), context=request),
        yearlyDayOfMonth1=translate(pfr_message(u'yearly_day_of_month_1'), context=request),
        yearlyDayOfMonth1Human=translate(pfr_message(u'yearly_day_of_month_1_human'), context=request),
        yearlyDayOfMonth2=translate(pfr_message(u'yearly_day_of_month_2'), context=request),
        yearlyDayOfMonth3=translate(pfr_message(u'yearly_day_of_month_3'), context=request),
        yearlyWeekdayOfMonth1=translate(pfr_message(u'yearly_weekday_of_month_1'), context=request),
        yearlyWeekdayOfMonth1Human=translate(pfr_message(u'yearly_weekday_of_month_1_human'), context=request),
        yearlyWeekdayOfMonth2=translate(pfr_message(u'yearly_weekday_of_month_2'), context=request),
        yearlyWeekdayOfMonth3=translate(pfr_message(u'yearly_weekday_of_month_3'), context=request),
        yearlyWeekdayOfMonth4=translate(pfr_message(u'yearly_weekday_of_month_4'), context=request),
        yearlyRepeatOn=translate(pfr_message(u'yearly_repeat_on'), context=request),
        range=translate(pfr_message(u'range'), context=request),
        rangeNoEnd=translate(pfr_message(u'range_no_end'), context=request),
        rangeByOccurrences1=translate(pfr_message(u'range_by_occurrences_1'), context=request),
        rangeByOccurrences1Human=translate(pfr_message(u'range_by_occurrences_1_human'), context=request),
        rangeByOccurrences2=translate(pfr_message(u'range_by_occurrences_2'), context=request),
        rangeByEndDate=translate(pfr_message(u'range_by_end_date'), context=request),
        rangeByEndDateHuman=translate(pfr_message(u'range_by_end_date_human'), context=request),
        including=translate(pfr_message(u'including'), context=request),
        cancel=translate(pfr_message(u'cancel'), context=request),
        save=translate(pfr_message(u'save'), context=request),
        recurrenceStart=translate(pfr_message(u'recurrence_start'), context=request),
        additionalDate=translate(pfr_message(u'additional_date'), context=request),
        include=translate(pfr_message(u'include'), context=request),
        exclude=translate(pfr_message(u'exclude'), context=request),
        remove=translate(pfr_message(u'remove'), context=request),
        orderIndexes=[
            translate(pfr_message(u'order_indexes_first'), context=request),
            translate(pfr_message(u'order_indexes_second'), context=request),
            translate(pfr_message(u'order_indexes_third'), context=request),
            translate(pfr_message(u'order_indexes_fourth'), context=request),
            translate(pfr_message(u'order_indexes_last'), context=request)
        ],
        months=[
            translate(pl_message(u'month_jan'), context=request),
            translate(pl_message(u'month_feb'), context=request),
            translate(pl_message(u'month_mar'), context=request),
            translate(pl_message(u'month_apr'), context=request),
            translate(pl_message(u'month_may'), context=request),
            translate(pl_message(u'month_jun'), context=request),
            translate(pl_message(u'month_jul'), context=request),
            translate(pl_message(u'month_aug'), context=request),
            translate(pl_message(u'month_sep'), context=request),
            translate(pl_message(u'month_oct'), context=request),
            translate(pl_message(u'month_nov'), context=request),
            translate(pl_message(u'month_dec'), context=request)
        ],
        shortMonths=[
            translate(pl_message(u'month_jan_abbr'), context=request),
            translate(pl_message(u'month_feb_abbr'), context=request),
            translate(pl_message(u'month_mar_abbr'), context=request),
            translate(pl_message(u'month_apr_abbr'), context=request),
            translate(pl_message(u'month_may_abbr'), context=request),
            translate(pl_message(u'month_jun_abbr'), context=request),
            translate(pl_message(u'month_jul_abbr'), context=request),
            translate(pl_message(u'month_aug_abbr'), context=request),
            translate(pl_message(u'month_sep_abbr'), context=request),
            translate(pl_message(u'month_oct_abbr'), context=request),
            translate(pl_message(u'month_nov_abbr'), context=request),
            translate(pl_message(u'month_dec_abbr'), context=request)
        ],
        weekdays=[
            translate(pl_message(u'weekday_sun'), context=request),
            translate(pl_message(u'weekday_mon'), context=request),
            translate(pl_message(u'weekday_tue'), context=request),
            translate(pl_message(u'weekday_wed'), context=request),
            translate(pl_message(u'weekday_thu'), context=request),
            translate(pl_message(u'weekday_fri'), context=request),
            translate(pl_message(u'weekday_sat'), context=request)
        ],
        shortWeekdays=[
            translate(pl_message(u'weekday_sun_abbr'), context=request),
            translate(pl_message(u'weekday_mon_abbr'), context=request),
            translate(pl_message(u'weekday_tue_abbr'), context=request),
            translate(pl_message(u'weekday_wed_abbr'), context=request),
            translate(pl_message(u'weekday_thu_abbr'), context=request),
            translate(pl_message(u'weekday_fri_abbr'), context=request),
            translate(pl_message(u'weekday_sat_abbr'), context=request)
        ],
        longDateFormat=translate(pfr_message(u'long_date_format'), context=request),
        shortDateFormat=translate(pl_message(u'date_format_short_datepicker'), context=request),
        unsupportedFeatures=translate(pfr_message(u'unsupported_features'), context=request),
        noTemplateMatch=translate(pfr_message(u'no_template_match'), context=request),
        multipleDayOfMonth=translate(pfr_message(u'multiple_day_of_month'), context=request),
        bysetpos=translate(pfr_message(u'bysetpos'), context=request),
        noRule=translate(pfr_message(u'no_rule'), context=request),
        noRepeatEvery=translate(pfr_message(u'no_repeat_every'), context=request),
        noEndDate=translate(pfr_message(u'no_end_date'), context=request),
        noRepeatOn=translate(pfr_message(u'no_repeat_on'), context=request),
        pastEndDate=translate(pfr_message(u'past_end_date'), context=request),
        noEndAfterNOccurrences=translate(pfr_message(u'no_end_after_n_occurrences'), context=request),
        alreadyAdded=translate(pfr_message(u'already_added'), context=request),
        rtemplate=dict(
            daily=translate(pfr_message(u'template_daily'), context=request),
            mondayfriday=translate(pfr_message(u'template_mondayfriday'), context=request),
            weekdays=translate(pfr_message(u'template_weekdays'), context=request),
            weekly=translate(pfr_message(u'template_weekly'), context=request),
            monthly=translate(pfr_message(u'template_monthly'), context=request),
            yearly=translate(pfr_message(u'template_yearly'), context=request),
        ),
        # a bit wonky here, except is a reserved word
        **{"except": translate(pfr_message(u'except'), context=request)}
    )
    return translation_table
