_acs-lang__locale_language_fallback (private)

 _acs-lang__locale_language_fallback

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

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) aa_silence_log_entries aa_silence_log_entries (public) _acs-lang__locale_language_fallback _acs-lang__locale_language_fallback _acs-lang__locale_language_fallback->aa_equals _acs-lang__locale_language_fallback->aa_log _acs-lang__locale_language_fallback->aa_log_result _acs-lang__locale_language_fallback->aa_run_with_teardown _acs-lang__locale_language_fallback->aa_silence_log_entries

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    #
    # Check if en_GB is enabled
    #
    set enabled_p [nsv_array exists lang_message_en_GB]
    #
    # Run the test
    #
    aa_run_with_teardown -test_code {
        #
        # Enable en_GB if necessary
        #
        if { ! $enabled_p } {
            lang::system::locale_set_enabled  -locale en_GB  -enabled_p 1
            #
            # GN: we see several message of the following form
            #
            #     Warning: Warning: No catalog files found for package acs-tcl in locales: en_GB
            #
            # Is this intended? However, it does not effect the
            # outcome of the regression test.
            #
            aa_silence_log_entries -severities warning {
                lang::catalog::import -locales en_GB
            }
        }
        #
        # Create messages
        #
        set package_key "acs-lang"
        set message_key [ad_generate_random_string]
        set us_message  [ad_generate_random_string]
        set gb_message  [ad_generate_random_string]
        #
        # Test missing en_GB returns en_US message key
        #
        ns_log notice 3

        lang::message::register "en_US" $package_key $message_key $us_message
        aa_equals "Looking up message in GB returns US message"  [lang::message::lookup "en_GB" "$package_key.$message_key" "NOT FOUND"]  $us_message
        #
        # Test existing en_GB returns en_GB message key
        #
        ns_log notice 4

        lang::message::register "en_GB" $package_key $message_key $gb_message
        aa_equals "Looking up message in GB returns GB message"  [lang::message::lookup "en_GB" "$package_key.$message_key" "NOT FOUND"]  $gb_message
    } -teardown_code {
        #
        # Clean up messages
        #
        db_dml delete_msg { delete from lang_messages where package_key = :package_key and message_key = :message_key }
        db_dml delete_key { delete from lang_message_keys where package_key = :package_key and message_key = :message_key }
        #
        # Disable en_GB if it was disabled previously
        #
        if { ! $enabled_p } {
            lang::system::locale_set_enabled  -locale en_GB  -enabled_p 0
            nsv_unset lang_message_en_GB
            db_dml delete_messages { delete from lang_messages where locale = 'en_GB' }
        }
    }
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "locale_language_fallback (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: