Home
The Toolkit for Online Communities
17479 Community Members, 0 members online, 1914 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : Notification intervals widget i18n : One Message

Forum OpenACS Development: Re: Notification intervals widget i18n

Collapse
Posted by Matthew Geddert on
you can't run tcl code within a select statement, but you can pull it out of the database and have the adp parser automatically translate it. You could do one of two things:

Either set up a select query like this:

<fullquery name="notification::get_intervals.select_intervals">
        <querytext>
            select '#notifications.' || name || '#' as name,
                   notification_intervals.interval_id
            from notification_intervals,
                 notification_types_intervals
            where notification_intervals.interval_id = notification_types_intervals.interval_id
            and type_id = :type_id
            order by n_seconds
        </querytext>
    </fullquery>
Note that some types of display procs do not automatically process these snippets - i've encountered this a few times, so if they don't it would need to be the same thing without the hash (#) sign and then run [_ notifications.name] as a separate process in tcl.

Or, even better, if you don't have the problems mentioned above would be to upgrade notifications and store the values as #notification.name# in the database table, that way they show up everywhere as translated messages. This is how thing such as dotlrn relationship types are stored in the db.