from plone.formwidget.recurrence import _
from plone.formwidget.recurrence import pl_message
from zope.i18n import translate


def translations(request):
    translation_table = dict(
        displayUnactivate=translate(_(u'display_unactivate'), context=request),
        displayActivate=translate(_(u'display_activate'), context=request),
        add_rules=translate(_(u'add_rules'), context=request),
        edit_rules=translate(_(u'edit_rules'), context=request),
        delete_rules=translate(_(u'delete_rules'), context=request),
        add=translate(_(u'add'), context=request),
        refresh=translate(_(u'refresh'), context=request),
        title=translate(_(u'title'), context=request),
        preview=translate(_(u'preview'), context=request),
        addDate=translate(_(u'add_date'), context=request),
        recurrenceType=translate(_(u'recurrence_type'), context=request),
        dailyInterval1=translate(_(u'daily_interval_1'), context=request),
        dailyInterval2=translate(_(u'daily_interval_2'), context=request),
        weeklyInterval1=translate(_(u'weekly_interval_1'), context=request),
        weeklyInterval2=translate(_(u'weekly_interval_2'), context=request),
        weeklyWeekdays=translate(_(u'weekly_weekdays'), context=request),
        weeklyWeekdaysHuman=translate(_(u'weekly_weekdays_human'), context=request),
        monthlyInterval1=translate(_(u'monthly_interval_1'), context=request),
        monthlyInterval2=translate(_(u'monthly_interval_2'), context=request),
        monthlyDayOfMonth1=translate(_(u'monthly_day_of_month_1'), context=request),
        monthlyDayOfMonth1Human=translate(_(u'monthly_day_of_month_1_human'), context=request),
        monthlyDayOfMonth2=translate(_(u'monthly_day_of_month_2'), context=request),
        monthlyDayOfMonth3=translate(_(u'monthly_day_of_month_3'), context=request),
        monthlyDayOfMonth4=translate(_(u'monthly_day_of_month_4'), context=request),
        monthlyWeekdayOfMonth1=translate(_(u'monthly_weekday_of_month_1'), context=request),
        monthlyWeekdayOfMonth1Human=translate(_(u'monthly_weekday_of_month_1_human'), context=request),
        monthlyWeekdayOfMonth2=translate(_(u'monthly_weekday_of_month_2'), context=request),
        monthlyWeekdayOfMonth3=translate(_(u'monthly_weekday_of_month_3'), context=request),
        monthlyRepeatOn=translate(_(u'monthly_repeat_on'), context=request),
        yearlyInterval1=translate(_(u'yearly_interval_1'), context=request),
        yearlyInterval2=translate(_(u'yearly_interval_2'), context=request),
        yearlyDayOfMonth1=translate(_(u'yearly_day_of_month_1'), context=request),
        yearlyDayOfMonth1Human=translate(_(u'yearly_day_of_month_1_human'), context=request),
        yearlyDayOfMonth2=translate(_(u'yearly_day_of_month_2'), context=request),
        yearlyDayOfMonth3=translate(_(u'yearly_day_of_month_3'), context=request),
        yearlyWeekdayOfMonth1=translate(_(u'yearly_weekday_of_month_1'), context=request),
        yearlyWeekdayOfMonth1Human=translate(_(u'yearly_weekday_of_month_1_human'), context=request),
        yearlyWeekdayOfMonth2=translate(_(u'yearly_weekday_of_month_2'), context=request),
        yearlyWeekdayOfMonth3=translate(_(u'yearly_weekday_of_month_3'), context=request),
        yearlyWeekdayOfMonth4=translate(_(u'yearly_weekday_of_month_4'), context=request),
        yearlyRepeatOn=translate(_(u'yearly_repeat_on'), context=request),
        range=translate(_(u'range'), context=request),
        rangeNoEnd=translate(_(u'range_no_end'), context=request),
        rangeByOccurrences1=translate(_(u'range_by_occurrences_1'), context=request),
        rangeByOccurrences1Human=translate(_(u'range_by_occurrences_1_human'), context=request),
        rangeByOccurrences2=translate(_(u'range_by_occurrences_2'), context=request),
        rangeByEndDate=translate(_(u'range_by_end_date'), context=request),
        rangeByEndDateHuman=translate(_(u'range_by_end_date_human'), context=request),
        including=translate(_(u'including'), context=request),
        cancel=translate(_(u'cancel'), context=request),
        save=translate(_(u'save'), context=request),
        recurrenceStart=translate(_(u'recurrence_start'), context=request),
        additionalDate=translate(_(u'additional_date'), context=request),
        include=translate(_(u'include'), context=request),
        exclude=translate(_(u'exclude'), context=request),
        remove=translate(_(u'remove'), context=request),
        orderIndexes=[
            translate(_(u'order_indexes_first'), context=request),
            translate(_(u'order_indexes_second'), context=request),
            translate(_(u'order_indexes_third'), context=request),
            translate(_(u'order_indexes_fourth'), context=request),
            translate(_(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(_(u'long_date_format'), context=request),
        shortDateFormat=translate(pl_message(u'date_format_short_datepicker'), context=request),
        unsupportedFeatures=translate(_(u'unsupported_features'), context=request),
        noTemplateMatch=translate(_(u'no_template_match'), context=request),
        multipleDayOfMonth=translate(_(u'multiple_day_of_month'), context=request),
        bysetpos=translate(_(u'bysetpos'), context=request),
        noRule=translate(_(u'no_rule'), context=request),
        noRepeatEvery=translate(_(u'no_repeat_every'), context=request),
        noEndDate=translate(_(u'no_end_date'), context=request),
        noRepeatOn=translate(_(u'no_repeat_on'), context=request),
        pastEndDate=translate(_(u'past_end_date'), context=request),
        noEndAfterNOccurrences=translate(_(u'no_end_after_n_occurrences'), context=request),
        alreadyAdded=translate(_(u'already_added'), context=request),
        rtemplate=dict(
            daily=translate(_(u'template_daily'), context=request),
            mondayfriday=translate(_(u'template_mondayfriday'), context=request),
            weekdays=translate(_(u'template_weekdays'), context=request),
            weekly=translate(_(u'template_weekly'), context=request),
            monthly=translate(_(u'template_monthly'), context=request),
            yearly=translate(_(u'template_yearly'), context=request),
        ),
        # a bit wonky here, except is a reserved word
        **{"except": translate(_(u'except'), context=request)}
    )
    return translation_table
