Skip to content

Discuss: Add more translation affordances to date fields #323

Description

@plocket

Edit: could be very useful in upcoming immigrant safety forms.

A few more details on what's holding up this PR:

  • translating without making the user add alMonthLabel: ${ word('Month') } each time. This fix will have to be upstream, but my suggestion is to add a feature to CustomDataTypes. Right now, custom datatypes have an attribute, mako_parameters, like this:

    mako_parameters = [
         ...
         "alMonthLabel",
         "alDayLabel",
         "alYearLabel",
     ]

    We should add another attribute, something like default_mako_parameters, which would look like:

    default_mako_parameters = {
        "alMonthLabel": "${ word('Month') }"
        ...
     }

    i.e. a dictionary from the parameter to a python expression as a string that will be evaluated during the interview if the author doesn't give a value for the param. Doing this should be backwards compatible with how we do it now, if we release and folks start using these params. This feature would just extend it for folks who don't use it yet.

  • translating other ui and error messages. These include:

My priorities are still elsewhere, so I can't spend too much time on this, but we can discuss at the next deep dive, and if this plan sounds good, we can merge this PR.

Originally posted by @BryceStevenWilley in #317 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions