Skip to content

Same python expression in a template line not translated #428

@JonDehn

Description

@JonDehn

I have this code in a template:

                        <fieldset class="age-group-set">
                            <legend>Age Group:</legend>
                            <div tal:repeat="ag age_groups" tal:omit-tag="True">
                                <input form="entry_form" id="${ag.name}" name="age_group" type="radio"
                                       value="${ag.name}" ${ag.checked} >
                                <label for="${ag.name}">${ag.name}</label>
                            </div>
                        </fieldset>

"age_groups" is a list of Objects with attributes 'name' and 'checked'

Note that python variable "ag.name" appears in 4 places in the template, and the ag.checked variable once.

There are four entries in the "age_groups" list, "(Preschool, ' '), ('Child', ' '), ('Teen', ' ') and ('Adult', 'checked').

On Chrome (I have not tried on other browsers), I get this, where sometimes ${ag.name} is properly translated, and sometimes not (just left as "${ag.name}"

  | Age Group:   |     |   | Preschool   |     |     |   | Child   |     |     |   | Teen   |     |     |   | Adult   |     |   |  

I've tried several work-arounds, but nothing seems to get the proper translation. Is there something I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions