lang::catalog::translate (private)

 lang::catalog::translate

Defined in packages/acs-lang/tcl/lang-catalog-procs.tcl

Translates all untranslated strings in a message catalog from English into Spanish, French and German using Babelfish. NOTE: this proc is unmaintained. Quick way to get a multilingual site up and running if you can live with the quality of the translations.

Not a good idea to run this procedure if you have a large message catalog. Use for testing purposes only.

Author:
John Lowry <lowry@arsdigita.com>

Partial Call Graph (max 5 caller/called nodes):
%3 ad_try ad_try (public) apm_package_id_from_key apm_package_id_from_key (public) db_foreach db_foreach (public) lang::message::register lang::message::register (public) parameter::get parameter::get (public) lang::catalog::translate lang::catalog::translate lang::catalog::translate->ad_try lang::catalog::translate->apm_package_id_from_key lang::catalog::translate->db_foreach lang::catalog::translate->lang::message::register lang::catalog::translate->parameter::get

Testcases:
No testcase defined.
Source code:
    set default_locale [parameter::get -package_id [apm_package_id_from_key acs-lang] -parameter SiteWideLocale]
    db_foreach get_untranslated_messages {} {
        foreach lang [list es_ES fr_FR de_DE] {
            ad_try {
                set translated_message [lang_babel_translate $message en_$lang]
            } on error {errorMsg} {
                ns_log Error "Error translating $message into $lang: $errorMsg"
            } ok ok {r} {
                lang::message::register $lang $package_key $message_key $translated_message
            }
        }
    }
Generic XQL file:
<fullquery name="lang::catalog::translate.get_untranslated_messages">
    <querytext>
      select message_key,
             package_key,
             message 
      from   lang_messages lm1 
      where  locale = :default_locale
      and    not exists (select message_key, package_key
                         from   lang_messages lm2 
                         where  locale != :default_locale
                         and    lm1.message_key = lm2.message_key
                         and    lm1.package_key = lm2.package_key)
    </querytext>
</fullquery>
packages/acs-lang/tcl/lang-catalog-procs.xql

PostgreSQL XQL file:
packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql

Oracle XQL file:
packages/acs-lang/tcl/lang-catalog-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: