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):
- 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