Index: openacs-4/packages/acs-lang/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/index.tcl,v diff -u -r1.15.2.2 -r1.15.2.3 --- openacs-4/packages/acs-lang/www/admin/index.tcl 15 Apr 2019 16:34:14 -0000 1.15.2.2 +++ openacs-4/packages/acs-lang/www/admin/index.tcl 23 Apr 2019 19:25:25 -0000 1.15.2.3 @@ -43,21 +43,39 @@ -message [_ acs-lang.Are_you_sure_you_want_to_export_all_I18N_messages_to_catalog_files] # Retrieve locale information +set locale_list [db_list locale_list_select {select locale from ad_locales order by locale}] + +template::multirow create locales \ + locale \ + locale_label \ + escaped_locale \ + msg_edit_url \ + enabled_p \ + default_p \ + language \ + locale_edit_url \ + locale_delete_url \ + locale_make_default_url \ + locale_enabled_p_url \ + num_messages_pretty \ + num_messages \ + num_translated_pretty \ + num_translated \ + num_untranslated_pretty \ + num_untranslated \ + num_deleted_pretty \ + num_deleted \ + num_locales_for_language_pretty \ + num_locales_for_language + +# Populate multirow set default_locale "en_US" -db_multirow -extend { - escaped_locale - msg_edit_url - locale_edit_url - locale_delete_url - locale_make_default_url - locale_enabled_p_url - num_messages_pretty - num_translated_pretty - num_untranslated_pretty - num_deleted_pretty - num_locales_for_language_pretty -} locales count_locales {} { +foreach current_locale $locale_list { # + # Get values per locale + # + db_0or1row locale_stats {} + # # Encode locale # set escaped_locale [ns_urlencode $locale] @@ -81,6 +99,31 @@ set num_untranslated_pretty [lc_numeric $num_untranslated] set num_deleted_pretty [lc_numeric $num_deleted] set num_locales_for_language_pretty [lc_numeric $num_locales_for_language] + # + # Append to multirow + # + template::multirow append locales \ + $locale \ + $locale_label \ + $escaped_locale \ + $msg_edit_url \ + $enabled_p \ + $default_p \ + $language \ + $locale_edit_url \ + $locale_delete_url \ + $locale_make_default_url \ + $locale_enabled_p_url \ + $num_messages_pretty \ + $num_messages \ + $num_translated_pretty \ + $num_translated \ + $num_untranslated_pretty \ + $num_untranslated \ + $num_deleted_pretty \ + $num_deleted \ + $num_locales_for_language_pretty \ + $num_locales_for_language } # Local variables: Index: openacs-4/packages/acs-lang/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/index.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-lang/www/admin/index.xql 15 Apr 2019 16:34:14 -0000 1.1.2.1 +++ openacs-4/packages/acs-lang/www/admin/index.xql 23 Apr 2019 19:25:25 -0000 1.1.2.2 @@ -1,7 +1,7 @@ - + select @@ -19,14 +19,15 @@ case when num_untranslated is null then 0 else num_untranslated end, case when num_deleted is null then 0 else num_deleted end from ( - select locale, + select + locale, count(*) as num_messages, count(message_is_not_null + messages_not_deleted) as num_translated, count(message_is_null + default_message_not_deleted + message_not_deleted) as num_untranslated, count(any_message_deleted) as num_deleted from ( select - lm2.locale, + case when lm2.locale is null then :current_locale else lm2.locale end locale, case when lm2.message is null then 1 end message_is_null, case when lm2.message is not null then 1 end message_is_not_null, case when lm1.deleted_p = 't' or lm2.deleted_p = 't' then 1 end any_message_deleted, @@ -36,14 +37,15 @@ from lang_messages lm1 left outer join lang_messages lm2 on ( - lm2.message_key = lm1.message_key + lm2.locale = :current_locale + and lm2.message_key = lm1.message_key and lm2.package_key = lm1.package_key ) where lm1.locale = :default_locale ) locale_messages group by locale - ) locale_summary right outer join + ) locale_summary join ad_locales al on al.locale = locale_summary.locale group by