Previous: Printf Ordering, Up: Translator i18n



9.4.3 awk Portability Issues

gawk's internationalization features were purposely chosen to have as little impact as possible on the portability of awk programs that use them to other versions of awk. Consider this program:

     BEGIN {
         TEXTDOMAIN = "guide"
         if (Test_Guide)   # set with -v
             bindtextdomain("/test/guide/messages")
         print _"don't panic!"
     }

As written, it won't work on other versions of awk. However, it is actually almost portable, requiring very little change:


Footnotes

[1] This is good fodder for an “Obfuscated awk” contest.