_acs-lang__localize (private)
_acs-lang__localize
Defined in packages/acs-lang/tcl/test/acs-lang-test-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ set package_key "acs-lang" set message_key "__test-key" set message "Test message" aa_run_with_teardown -rollback -test_code { # Create a temporary test message to test with lang::message::register en_US $package_key $message_key $message # Create some random character strings to surround the embedded key set pre_text "a;<ls#;#kdfj'...,mlkjoiu><wgon" set post_text "a;lskd<fj'...,mlkjo>iuwgon#" set message_key_embedded "#${package_key}.${message_key}#" # Test replacements set text1 $message_key_embedded aa_equals "One message key with no surrounding text" [lang::util::localize $text1] $message set text1 "${pre_text}${message_key_embedded}${post_text}" aa_equals "One message key with surrounding text" [lang::util::localize $text1] "${pre_text}${message}${post_text}" set text1 "${pre_text}${message_key_embedded}" aa_equals "One message key with text before" [lang::util::localize $text1] "${pre_text}${message}" set text1 "${message_key_embedded}${post_text}" aa_equals "One message key with text after" [lang::util::localize $text1] "${message}${post_text}" set text1 "${pre_text}${message_key_embedded}${post_text}${pre_text}${message_key_embedded}${post_text}" aa_equals "Two message keys with surrounding text" [lang::util::localize $text1] "${pre_text}${message}${post_text}${pre_text}${message}${post_text}" } -teardown_code { # We need to clear the cache lang::message::unregister $package_key $message_key } }} { 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" "localize (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle