aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog6
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info448
-rw-r--r--doc/gawk.texi33
-rw-r--r--doc/gawktexi.in33
-rw-r--r--interpret.h5
6 files changed, 300 insertions, 230 deletions
diff --git a/ChangeLog b/ChangeLog
index 8dd3b4af..27fee925 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * interpret.h (r_interpret): For a translatable string, only copy
+ the gettext return value if it's different from the original.
+ Otherwise, use the original.
+
2019-01-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
Use a struct instead of an array to contain the array methods
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 7a31fa97..4bbc906c 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (I18N Example): Add more explanation of how to
+ make the directory to hold the .mo file.
+
2019-01-04 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Indexing fixes and small corrections.
diff --git a/doc/gawk.info b/doc/gawk.info
index 18a834f0..2171d6f2 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -21509,19 +21509,33 @@ Following are the translations:
msgstr "Like, the scoop is"
+ NOTE: The following instructions apply to GNU/Linux with the GNU C
+ Library. Be aware that the actual steps may change over time, that
+ the following description may not be accurate for all GNU/Linux
+ distributions, and that things may work entirely differently on
+ other operating systems.
+
The next step is to make the directory to hold the binary message
-object file and then to create the 'guide.mo' file. We pretend that our
-file is to be used in the 'en_US.UTF-8' locale, because we have to use a
-locale name known to the C 'gettext' routines. The directory layout
-shown here is standard for GNU 'gettext' on GNU/Linux systems. Other
-versions of 'gettext' may use a different layout:
+object file and then to create the 'guide.mo' file. The directory has
+the form 'LOCALE/LC_MESSAGES', where LOCALE is a locale name known to
+the C 'gettext' routines.
+
+ How do we know which locale to use? It turns out that there are
+three different environment variables used by the C 'gettext' routines.
+In order, they are '$LANGUAGE', '$LC_ALL', and '$LANG'.(2) Thus, we
+check the value of '$LANGUAGE':
+
+ $ echo $LANGUAGE
+ -| en_US.UTF-8
+
+We next make the directories:
$ mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES
- The 'msgfmt' utility does the conversion from human-readable '.po'
-file to machine-readable '.mo' file. By default, 'msgfmt' creates a
-file named 'messages'. This file must be renamed and placed in the
-proper directory (using the '-o' option) so that 'gawk' can find it:
+ The 'msgfmt' utility converts the human-readable '.po' file into a
+machine-readable '.mo' file. By default, 'msgfmt' creates a file named
+'messages'. This file must be renamed and placed in the proper
+directory (using the '-o' option) so that 'gawk' can find it:
$ msgfmt guide-mellow.po -o en_US.UTF-8/LC_MESSAGES/guide.mo
@@ -21545,6 +21559,9 @@ and 'bindtextdomain()' (*note I18N Portability::) are in a file named
(1) Perhaps it would be better if it were called "Hippy." Ah, well.
+ (2) Well, sort of. It seems that if '$LC_ALL' is set to 'C', then no
+translations are done. Go figure.
+

File: gawk.info, Node: Gawk I18N, Next: I18N Summary, Prev: I18N Example, Up: Internationalization
@@ -33175,10 +33192,10 @@ Index
* .gmo files: Explaining gettext. (line 42)
* .gmo files, specifying directory of: Explaining gettext. (line 54)
* .gmo files, specifying directory of <1>: Programmer i18n. (line 48)
-* .mo files, converting from .po: I18N Example. (line 66)
+* .mo files, converting from .po: I18N Example. (line 80)
* .po files: Explaining gettext. (line 37)
* .po files <1>: Translator i18n. (line 6)
-* .po files, converting to .mo: I18N Example. (line 66)
+* .po files, converting to .mo: I18N Example. (line 80)
* .pot files: Explaining gettext. (line 31)
* / (forward slash) to enclose regular expressions: Regexp. (line 10)
* / (forward slash), / operator: Precedence. (line 54)
@@ -34452,10 +34469,10 @@ Index
* files, .gmo: Explaining gettext. (line 42)
* files, .gmo, specifying directory of: Explaining gettext. (line 54)
* files, .gmo, specifying directory of <1>: Programmer i18n. (line 48)
-* files, .mo, converting from .po: I18N Example. (line 66)
+* files, .mo, converting from .po: I18N Example. (line 80)
* files, .po: Explaining gettext. (line 37)
* files, .po <1>: Translator i18n. (line 6)
-* files, .po, converting to .mo: I18N Example. (line 66)
+* files, .po, converting to .mo: I18N Example. (line 80)
* files, .pot: Explaining gettext. (line 31)
* files, /dev/... special files: Special FD. (line 48)
* files, /inet/... (gawk): TCP/IP Networking. (line 6)
@@ -34475,7 +34492,7 @@ Index
* files, managing, data file boundaries: Filetrans Function. (line 6)
* files, message object: Explaining gettext. (line 42)
* files, message object, converting from portable object files: I18N Example.
- (line 66)
+ (line 80)
* files, message object, specifying directory of: Explaining gettext.
(line 54)
* files, message object, specifying directory of <1>: Programmer i18n.
@@ -34489,7 +34506,7 @@ Index
* files, portable object <1>: Translator i18n. (line 6)
* files, portable object template: Explaining gettext. (line 31)
* files, portable object, converting to message object files: I18N Example.
- (line 66)
+ (line 80)
* files, portable object, generating: Options. (line 161)
* files, processing, ARGIND variable and: Auto-set. (line 50)
* files, reading: Rewind Function. (line 6)
@@ -35115,7 +35132,7 @@ Index
(line 6)
* message object files: Explaining gettext. (line 42)
* message object files, converting from portable object files: I18N Example.
- (line 66)
+ (line 80)
* message object files, specifying directory of: Explaining gettext.
(line 54)
* message object files, specifying directory of <1>: Programmer i18n.
@@ -35130,7 +35147,7 @@ Index
* Moore, Duncan: Getline Notes. (line 40)
* MPFR, checking availability of: Checking for MPFR. (line 6)
* MPFR, checking for: Checking for MPFR. (line 6)
-* msgfmt utility: I18N Example. (line 66)
+* msgfmt utility: I18N Example. (line 80)
* multiple precision: Arbitrary Precision Arithmetic.
(line 6)
* multiple-line records: Multiple Line. (line 6)
@@ -35378,7 +35395,7 @@ Index
* portable object files: Explaining gettext. (line 37)
* portable object files <1>: Translator i18n. (line 6)
* portable object files, converting to message object files: I18N Example.
- (line 66)
+ (line 80)
* portable object files, generating: Options. (line 161)
* portable object template files: Explaining gettext. (line 31)
* porting gawk: New Ports. (line 6)
@@ -36593,202 +36610,203 @@ Ref: Printf Ordering-Footnote-1868756
Node: I18N Portability868820
Ref: I18N Portability-Footnote-1871276
Node: I18N Example871339
-Ref: I18N Example-Footnote-1874145
-Node: Gawk I18N874218
-Node: I18N Summary874863
-Node: Debugger876204
-Node: Debugging877224
-Node: Debugging Concepts877665
-Node: Debugging Terms879474
-Node: Awk Debugging882049
-Ref: Awk Debugging-Footnote-1882994
-Node: Sample Debugging Session883126
-Node: Debugger Invocation883660
-Node: Finding The Bug885046
-Node: List of Debugger Commands891520
-Node: Breakpoint Control892853
-Node: Debugger Execution Control896547
-Node: Viewing And Changing Data899909
-Node: Execution Stack903283
-Node: Debugger Info904920
-Node: Miscellaneous Debugger Commands908991
-Node: Readline Support914053
-Node: Limitations914949
-Node: Debugging Summary917058
-Node: Arbitrary Precision Arithmetic918337
-Node: Computer Arithmetic919822
-Ref: table-numeric-ranges923588
-Ref: table-floating-point-ranges924081
-Ref: Computer Arithmetic-Footnote-1924739
-Node: Math Definitions924796
-Ref: table-ieee-formats928112
-Ref: Math Definitions-Footnote-1928715
-Node: MPFR features928820
-Node: FP Math Caution930538
-Ref: FP Math Caution-Footnote-1931610
-Node: Inexactness of computations931979
-Node: Inexact representation932939
-Node: Comparing FP Values934299
-Node: Errors accumulate935540
-Node: Getting Accuracy936973
-Node: Try To Round939683
-Node: Setting precision940582
-Ref: table-predefined-precision-strings941279
-Node: Setting the rounding mode943109
-Ref: table-gawk-rounding-modes943483
-Ref: Setting the rounding mode-Footnote-1947414
-Node: Arbitrary Precision Integers947593
-Ref: Arbitrary Precision Integers-Footnote-1950768
-Node: Checking for MPFR950917
-Node: POSIX Floating Point Problems952391
-Ref: POSIX Floating Point Problems-Footnote-1956676
-Node: Floating point summary956714
-Node: Dynamic Extensions958904
-Node: Extension Intro960457
-Node: Plugin License961723
-Node: Extension Mechanism Outline962520
-Ref: figure-load-extension962959
-Ref: figure-register-new-function964524
-Ref: figure-call-new-function965616
-Node: Extension API Description967678
-Node: Extension API Functions Introduction969320
-Node: General Data Types974860
-Ref: General Data Types-Footnote-1983221
-Node: Memory Allocation Functions983520
-Ref: Memory Allocation Functions-Footnote-1987730
-Node: Constructor Functions987829
-Node: Registration Functions991415
-Node: Extension Functions992100
-Node: Exit Callback Functions997315
-Node: Extension Version String998565
-Node: Input Parsers999228
-Node: Output Wrappers1011949
-Node: Two-way processors1016461
-Node: Printing Messages1018726
-Ref: Printing Messages-Footnote-11019897
-Node: Updating ERRNO1020050
-Node: Requesting Values1020789
-Ref: table-value-types-returned1021526
-Node: Accessing Parameters1022462
-Node: Symbol Table Access1023697
-Node: Symbol table by name1024209
-Node: Symbol table by cookie1025998
-Ref: Symbol table by cookie-Footnote-11030183
-Node: Cached values1030247
-Ref: Cached values-Footnote-11033783
-Node: Array Manipulation1033936
-Ref: Array Manipulation-Footnote-11035027
-Node: Array Data Types1035064
-Ref: Array Data Types-Footnote-11037722
-Node: Array Functions1037814
-Node: Flattening Arrays1042312
-Node: Creating Arrays1049288
-Node: Redirection API1054055
-Node: Extension API Variables1056888
-Node: Extension Versioning1057599
-Ref: gawk-api-version1058028
-Node: Extension GMP/MPFR Versioning1059759
-Node: Extension API Informational Variables1061387
-Node: Extension API Boilerplate1062460
-Node: Changes from API V11066434
-Node: Finding Extensions1068006
-Node: Extension Example1068565
-Node: Internal File Description1069363
-Node: Internal File Ops1073443
-Ref: Internal File Ops-Footnote-11084793
-Node: Using Internal File Ops1084933
-Ref: Using Internal File Ops-Footnote-11087316
-Node: Extension Samples1087590
-Node: Extension Sample File Functions1089119
-Node: Extension Sample Fnmatch1096768
-Node: Extension Sample Fork1098255
-Node: Extension Sample Inplace1099473
-Node: Extension Sample Ord1102690
-Node: Extension Sample Readdir1103526
-Ref: table-readdir-file-types1104415
-Node: Extension Sample Revout1105220
-Node: Extension Sample Rev2way1105809
-Node: Extension Sample Read write array1106549
-Node: Extension Sample Readfile1108491
-Node: Extension Sample Time1109586
-Node: Extension Sample API Tests1110934
-Node: gawkextlib1111426
-Node: Extension summary1114344
-Node: Extension Exercises1118046
-Node: Language History1119544
-Node: V7/SVR3.11121200
-Node: SVR41123352
-Node: POSIX1124786
-Node: BTL1126166
-Node: POSIX/GNU1126895
-Node: Feature History1132673
-Node: Common Extensions1148719
-Node: Ranges and Locales1150002
-Ref: Ranges and Locales-Footnote-11154618
-Ref: Ranges and Locales-Footnote-21154645
-Ref: Ranges and Locales-Footnote-31154880
-Node: Contributors1155101
-Node: History summary1161046
-Node: Installation1162426
-Node: Gawk Distribution1163370
-Node: Getting1163854
-Node: Extracting1164817
-Node: Distribution contents1166455
-Node: Unix Installation1172935
-Node: Quick Installation1173617
-Node: Shell Startup Files1176031
-Node: Additional Configuration Options1177120
-Node: Configuration Philosophy1179285
-Node: Non-Unix Installation1181654
-Node: PC Installation1182114
-Node: PC Binary Installation1182952
-Node: PC Compiling1183387
-Node: PC Using1184504
-Node: Cygwin1188057
-Node: MSYS1189156
-Node: VMS Installation1189657
-Node: VMS Compilation1190448
-Ref: VMS Compilation-Footnote-11191677
-Node: VMS Dynamic Extensions1191735
-Node: VMS Installation Details1193420
-Node: VMS Running1195673
-Node: VMS GNV1199952
-Node: VMS Old Gawk1200687
-Node: Bugs1201158
-Node: Bug address1201821
-Node: Usenet1204803
-Node: Maintainers1205807
-Node: Other Versions1207068
-Node: Installation summary1213982
-Node: Notes1215184
-Node: Compatibility Mode1215978
-Node: Additions1216760
-Node: Accessing The Source1217685
-Node: Adding Code1219122
-Node: New Ports1225341
-Node: Derived Files1229829
-Ref: Derived Files-Footnote-11235475
-Ref: Derived Files-Footnote-21235510
-Ref: Derived Files-Footnote-31236108
-Node: Future Extensions1236222
-Node: Implementation Limitations1236880
-Node: Extension Design1238063
-Node: Old Extension Problems1239207
-Ref: Old Extension Problems-Footnote-11240725
-Node: Extension New Mechanism Goals1240782
-Ref: Extension New Mechanism Goals-Footnote-11244146
-Node: Extension Other Design Decisions1244335
-Node: Extension Future Growth1246448
-Node: Notes summary1247284
-Node: Basic Concepts1248459
-Node: Basic High Level1249140
-Ref: figure-general-flow1249422
-Ref: figure-process-flow1250107
-Ref: Basic High Level-Footnote-11253408
-Node: Basic Data Typing1253593
-Node: Glossary1256921
-Node: Copying1288759
-Node: GNU Free Documentation License1326302
-Node: Index1351422
+Ref: I18N Example-Footnote-1874599
+Ref: I18N Example-Footnote-2874672
+Node: Gawk I18N874781
+Node: I18N Summary875426
+Node: Debugger876767
+Node: Debugging877787
+Node: Debugging Concepts878228
+Node: Debugging Terms880037
+Node: Awk Debugging882612
+Ref: Awk Debugging-Footnote-1883557
+Node: Sample Debugging Session883689
+Node: Debugger Invocation884223
+Node: Finding The Bug885609
+Node: List of Debugger Commands892083
+Node: Breakpoint Control893416
+Node: Debugger Execution Control897110
+Node: Viewing And Changing Data900472
+Node: Execution Stack903846
+Node: Debugger Info905483
+Node: Miscellaneous Debugger Commands909554
+Node: Readline Support914616
+Node: Limitations915512
+Node: Debugging Summary917621
+Node: Arbitrary Precision Arithmetic918900
+Node: Computer Arithmetic920385
+Ref: table-numeric-ranges924151
+Ref: table-floating-point-ranges924644
+Ref: Computer Arithmetic-Footnote-1925302
+Node: Math Definitions925359
+Ref: table-ieee-formats928675
+Ref: Math Definitions-Footnote-1929278
+Node: MPFR features929383
+Node: FP Math Caution931101
+Ref: FP Math Caution-Footnote-1932173
+Node: Inexactness of computations932542
+Node: Inexact representation933502
+Node: Comparing FP Values934862
+Node: Errors accumulate936103
+Node: Getting Accuracy937536
+Node: Try To Round940246
+Node: Setting precision941145
+Ref: table-predefined-precision-strings941842
+Node: Setting the rounding mode943672
+Ref: table-gawk-rounding-modes944046
+Ref: Setting the rounding mode-Footnote-1947977
+Node: Arbitrary Precision Integers948156
+Ref: Arbitrary Precision Integers-Footnote-1951331
+Node: Checking for MPFR951480
+Node: POSIX Floating Point Problems952954
+Ref: POSIX Floating Point Problems-Footnote-1957239
+Node: Floating point summary957277
+Node: Dynamic Extensions959467
+Node: Extension Intro961020
+Node: Plugin License962286
+Node: Extension Mechanism Outline963083
+Ref: figure-load-extension963522
+Ref: figure-register-new-function965087
+Ref: figure-call-new-function966179
+Node: Extension API Description968241
+Node: Extension API Functions Introduction969883
+Node: General Data Types975423
+Ref: General Data Types-Footnote-1983784
+Node: Memory Allocation Functions984083
+Ref: Memory Allocation Functions-Footnote-1988293
+Node: Constructor Functions988392
+Node: Registration Functions991978
+Node: Extension Functions992663
+Node: Exit Callback Functions997878
+Node: Extension Version String999128
+Node: Input Parsers999791
+Node: Output Wrappers1012512
+Node: Two-way processors1017024
+Node: Printing Messages1019289
+Ref: Printing Messages-Footnote-11020460
+Node: Updating ERRNO1020613
+Node: Requesting Values1021352
+Ref: table-value-types-returned1022089
+Node: Accessing Parameters1023025
+Node: Symbol Table Access1024260
+Node: Symbol table by name1024772
+Node: Symbol table by cookie1026561
+Ref: Symbol table by cookie-Footnote-11030746
+Node: Cached values1030810
+Ref: Cached values-Footnote-11034346
+Node: Array Manipulation1034499
+Ref: Array Manipulation-Footnote-11035590
+Node: Array Data Types1035627
+Ref: Array Data Types-Footnote-11038285
+Node: Array Functions1038377
+Node: Flattening Arrays1042875
+Node: Creating Arrays1049851
+Node: Redirection API1054618
+Node: Extension API Variables1057451
+Node: Extension Versioning1058162
+Ref: gawk-api-version1058591
+Node: Extension GMP/MPFR Versioning1060322
+Node: Extension API Informational Variables1061950
+Node: Extension API Boilerplate1063023
+Node: Changes from API V11066997
+Node: Finding Extensions1068569
+Node: Extension Example1069128
+Node: Internal File Description1069926
+Node: Internal File Ops1074006
+Ref: Internal File Ops-Footnote-11085356
+Node: Using Internal File Ops1085496
+Ref: Using Internal File Ops-Footnote-11087879
+Node: Extension Samples1088153
+Node: Extension Sample File Functions1089682
+Node: Extension Sample Fnmatch1097331
+Node: Extension Sample Fork1098818
+Node: Extension Sample Inplace1100036
+Node: Extension Sample Ord1103253
+Node: Extension Sample Readdir1104089
+Ref: table-readdir-file-types1104978
+Node: Extension Sample Revout1105783
+Node: Extension Sample Rev2way1106372
+Node: Extension Sample Read write array1107112
+Node: Extension Sample Readfile1109054
+Node: Extension Sample Time1110149
+Node: Extension Sample API Tests1111497
+Node: gawkextlib1111989
+Node: Extension summary1114907
+Node: Extension Exercises1118609
+Node: Language History1120107
+Node: V7/SVR3.11121763
+Node: SVR41123915
+Node: POSIX1125349
+Node: BTL1126729
+Node: POSIX/GNU1127458
+Node: Feature History1133236
+Node: Common Extensions1149282
+Node: Ranges and Locales1150565
+Ref: Ranges and Locales-Footnote-11155181
+Ref: Ranges and Locales-Footnote-21155208
+Ref: Ranges and Locales-Footnote-31155443
+Node: Contributors1155664
+Node: History summary1161609
+Node: Installation1162989
+Node: Gawk Distribution1163933
+Node: Getting1164417
+Node: Extracting1165380
+Node: Distribution contents1167018
+Node: Unix Installation1173498
+Node: Quick Installation1174180
+Node: Shell Startup Files1176594
+Node: Additional Configuration Options1177683
+Node: Configuration Philosophy1179848
+Node: Non-Unix Installation1182217
+Node: PC Installation1182677
+Node: PC Binary Installation1183515
+Node: PC Compiling1183950
+Node: PC Using1185067
+Node: Cygwin1188620
+Node: MSYS1189719
+Node: VMS Installation1190220
+Node: VMS Compilation1191011
+Ref: VMS Compilation-Footnote-11192240
+Node: VMS Dynamic Extensions1192298
+Node: VMS Installation Details1193983
+Node: VMS Running1196236
+Node: VMS GNV1200515
+Node: VMS Old Gawk1201250
+Node: Bugs1201721
+Node: Bug address1202384
+Node: Usenet1205366
+Node: Maintainers1206370
+Node: Other Versions1207631
+Node: Installation summary1214545
+Node: Notes1215747
+Node: Compatibility Mode1216541
+Node: Additions1217323
+Node: Accessing The Source1218248
+Node: Adding Code1219685
+Node: New Ports1225904
+Node: Derived Files1230392
+Ref: Derived Files-Footnote-11236038
+Ref: Derived Files-Footnote-21236073
+Ref: Derived Files-Footnote-31236671
+Node: Future Extensions1236785
+Node: Implementation Limitations1237443
+Node: Extension Design1238626
+Node: Old Extension Problems1239770
+Ref: Old Extension Problems-Footnote-11241288
+Node: Extension New Mechanism Goals1241345
+Ref: Extension New Mechanism Goals-Footnote-11244709
+Node: Extension Other Design Decisions1244898
+Node: Extension Future Growth1247011
+Node: Notes summary1247847
+Node: Basic Concepts1249022
+Node: Basic High Level1249703
+Ref: figure-general-flow1249985
+Ref: figure-process-flow1250670
+Ref: Basic High Level-Footnote-11253971
+Node: Basic Data Typing1254156
+Node: Glossary1257484
+Node: Copying1289322
+Node: GNU Free Documentation License1326865
+Node: Index1351985

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 4f3535ea..e661c6fa 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -30086,13 +30086,32 @@ msgstr "Like, the scoop is"
@cindex Linux
@cindex GNU/Linux
+@quotation NOTE
+The following instructions apply to GNU/Linux with the GNU C Library. Be
+aware that the actual steps may change over time, that the following
+description may not be accurate for all GNU/Linux distributions, and
+that things may work entirely differently on other operating systems.
+@end quotation
+
The next step is to make the directory to hold the binary message object
file and then to create the @file{guide.mo} file.
-We pretend that our file is to be used in the @code{en_US.UTF-8} locale,
-because we have to use a locale name known to the C @command{gettext} routines.
-The directory layout shown here is standard for GNU @command{gettext} on
-GNU/Linux systems. Other versions of @command{gettext} may use a different
-layout:
+The directory has the form @file{@var{locale}/LC_MESSAGES}, where
+@var{locale} is a locale name known to the C @command{gettext} routines.
+
+How do we know which locale to use? It turns out that there are
+three different environment variables used by the C @command{gettext} routines.
+In order, they are @env{$LANGUAGE}, @env{$LC_ALL}, and @env{$LANG}.@footnote{Well,
+sort of. It seems that if @env{$LC_ALL} is set to @samp{C}, then no translations
+are done. Go figure.}
+Thus, we check the value of @env{$LANGUAGE}:
+
+@example
+$ @kbd{echo $LANGUAGE}
+@print{} en_US.UTF-8
+@end example
+
+@noindent
+We next make the directories:
@example
$ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
@@ -30107,8 +30126,8 @@ $ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
@cindex message object files, converting from portable object files
@cindex files, message object, converting from portable object files
@cindex @command{msgfmt} utility
-The @command{msgfmt} utility does the conversion from human-readable
-@file{.po} file to machine-readable @file{.mo} file.
+The @command{msgfmt} utility converts the human-readable
+@file{.po} file into a machine-readable @file{.mo} file.
By default, @command{msgfmt} creates a file named @file{messages}.
This file must be renamed and placed in the proper directory (using
the @option{-o} option) so that @command{gawk} can find it:
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index a186f902..f8850d9a 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -29099,13 +29099,32 @@ msgstr "Like, the scoop is"
@cindex Linux
@cindex GNU/Linux
+@quotation NOTE
+The following instructions apply to GNU/Linux with the GNU C Library. Be
+aware that the actual steps may change over time, that the following
+description may not be accurate for all GNU/Linux distributions, and
+that things may work entirely differently on other operating systems.
+@end quotation
+
The next step is to make the directory to hold the binary message object
file and then to create the @file{guide.mo} file.
-We pretend that our file is to be used in the @code{en_US.UTF-8} locale,
-because we have to use a locale name known to the C @command{gettext} routines.
-The directory layout shown here is standard for GNU @command{gettext} on
-GNU/Linux systems. Other versions of @command{gettext} may use a different
-layout:
+The directory has the form @file{@var{locale}/LC_MESSAGES}, where
+@var{locale} is a locale name known to the C @command{gettext} routines.
+
+How do we know which locale to use? It turns out that there are
+three different environment variables used by the C @command{gettext} routines.
+In order, they are @env{$LANGUAGE}, @env{$LC_ALL}, and @env{$LANG}.@footnote{Well,
+sort of. It seems that if @env{$LC_ALL} is set to @samp{C}, then no translations
+are done. Go figure.}
+Thus, we check the value of @env{$LANGUAGE}:
+
+@example
+$ @kbd{echo $LANGUAGE}
+@print{} en_US.UTF-8
+@end example
+
+@noindent
+We next make the directories:
@example
$ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
@@ -29120,8 +29139,8 @@ $ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES}
@cindex message object files, converting from portable object files
@cindex files, message object, converting from portable object files
@cindex @command{msgfmt} utility
-The @command{msgfmt} utility does the conversion from human-readable
-@file{.po} file to machine-readable @file{.mo} file.
+The @command{msgfmt} utility converts the human-readable
+@file{.po} file into a machine-readable @file{.mo} file.
By default, @command{msgfmt} creates a file named @file{messages}.
This file must be renamed and placed in the proper directory (using
the @option{-o} option) so that @command{gawk} can find it:
diff --git a/interpret.h b/interpret.h
index 6a1a08b4..1451f683 100644
--- a/interpret.h
+++ b/interpret.h
@@ -156,7 +156,10 @@ top:
orig = m->stptr;
trans = dgettext(TEXTDOMAIN, orig);
m->stptr[m->stlen] = save;
- m = make_string(trans, strlen(trans));
+ if (trans != orig) // got a translation
+ m = make_string(trans, strlen(trans));
+ else
+ UPREF(m);
} else
UPREF(m);
PUSH(m);