Internationalisation in Grid

33 views
Skip to first unread message

Stefan Messmer

unread,
Nov 29, 2025, 9:02:38 AM (5 days ago) Nov 29
to py4web
I got 3 problems when trying to translate the Grid interface:
1. The "Submit" button does not translate. All other buttons translate as expected.
2. How can I translate the line "Displaying rows 1 thru 20 of 100"
3. I have a field:
Field('status',type='inspection_status', 
   requires=IS_IN_SET([ 
      ('Not started',T('Not started')),
      ( 'Waiting',T('Waiting')),
      ('Ongoing',T('Ongoing')),
       ('Finished',T('Finished'))],
    zero='choose one'),
    default='Not started'),
In the list page, this field remains as it is stored in the database. In the edit page, the translated items show. How can I translate this field correctly?

Many thanks and best regards
Stefan Messmer

laundmo

unread,
Dec 2, 2025, 10:33:30 AM (2 days ago) Dec 2
to py4web
1. This is an issue in py4web FormStyleFactory, which has the "Submit" text hardcoded
2. This one is translated. It should either already be in one translation file as "Displaying rows %s thru %s of %s" or you can find it in T.missing

Stefan Messmer

unread,
Dec 3, 2025, 2:08:30 AM (yesterday) Dec 3
to py4web
Ok. Number 2 is solved now. 

Many thanks and best regards 
Stefan Messmer

Stefan Messmer

unread,
4:13 AM (13 hours ago) 4:13 AM
to py4web
I found a way to solve problem number 3. See IS_LIST_OF_EMAILS.

    Field('status',type='string',

        requires=IS_IN_SET([  

            ('Not started',T('Not started')),

            ( 'Waiting',T('Waiting')),

            ('Ongoing',T('Ongoing')),

            ('Finished',T('Finished'))],zero='choose one'

        ),

        represent=lambda v,r: T(v),

        default='Not started'),

The represent lambda function does what I need to do.

Best regards
Stefan
Reply all
Reply to author
Forward
0 new messages