1*946379e7Schristos 2*946379e7SchristosWelcome! 3*946379e7Schristos======== 4*946379e7Schristos 5*946379e7SchristosThis is the OS/2 port of GNU gettext internationalization library. 6*946379e7Schristos 7*946379e7Schristos 8*946379e7SchristosCompatibility 9*946379e7Schristos============= 10*946379e7Schristos 11*946379e7SchristosThe library has been compiled with -Zmt flag, but it doesn't matter as soon 12*946379e7Schristosas you use the EMX single-threaded runtime fix (emx-strt-fix-0.0.2.zip). 13*946379e7Schristos 14*946379e7SchristosThe library is fully compatible with the previous port of gettext library 15*946379e7Schristos(0.10.35) which is largely used especialy by XFree86/2 programs. All the 16*946379e7Schristosold programs that I have with gettext support run fine with the new version 17*946379e7Schristosof the DLL. 18*946379e7Schristos 19*946379e7Schristos 20*946379e7SchristosInstallation 21*946379e7Schristos============ 22*946379e7Schristos 23*946379e7SchristosIf you set the GNULOCALEDIR environment variable to point to your 24*946379e7Schristosx:/xxx/share/locale directory, it will override any other setting. That is, 25*946379e7Schristosunpack the binary distribution over /emx, set GNULOCALEDIR=x:/emx/share/locale 26*946379e7Schristos(where x: is the drive letter of your EMX installation) and that's all. 27*946379e7Schristos 28*946379e7SchristosIf you use the UNIXROOT environment variable, the default catalogue search 29*946379e7Schristospaths will be like on Unices, e.g. $(UNIXROOT)/usr/lib and 30*946379e7Schristos$(UNIXROOT)/usr/share/locale. GNULOCALEDIR always overrides this. 31*946379e7Schristos 32*946379e7SchristosNow if you haven't did it earlier, set the language identifier that you use. 33*946379e7SchristosThis is done by adding a "SET LANG=xxx" environment setting to your CONFIG.SYS, 34*946379e7Schristoswhere xxx is the identifier of your language (example: en_UK for English in UK, 35*946379e7Schristosru_RU for Russian in Russia. Also you can use names like "russian", "italian" 36*946379e7Schristosand so on - see the share/locale/locale.alias file). 37*946379e7Schristos 38*946379e7SchristosThis port of gettext supports character set conversions. This means that if 39*946379e7Schristosyour .mo files were written using new gettext guidelines, e.g. they contain a 40*946379e7Schristosmessage like this: 41*946379e7Schristos 42*946379e7Schristosmsgid "" 43*946379e7Schristosmsgstr "Content-Type: text/plain; charset=koi8-r\n" 44*946379e7Schristos 45*946379e7Schristosthe messages will be properly converted to your active codepage using OS/2 46*946379e7SchristosUnicode API. For example, russian message catalog gettext.mo is in the 47*946379e7SchristosKOI8-R (codepage 878) encoding while OS/2 uses codepage 866. Now when you 48*946379e7Schristosrun any of these tools it detects that the active OS/2 codepage is 866 and 49*946379e7Schristosperforms the translation from CP878 -> CP866 for every message. 50*946379e7Schristos 51*946379e7SchristosIf you want to override the character set used to output messages (for example 52*946379e7Schristosin XFree86 for Russian the KOI8-R encoding (codepage 878) is used) you can 53*946379e7Schristosset the output character set by adding a postfix to the LANG environment 54*946379e7Schristosvariable, this way: 55*946379e7Schristos 56*946379e7Schristosset LANG=ru_RU.KOI8-R 57*946379e7Schristos 58*946379e7Schristosor (equivalent): 59*946379e7Schristos 60*946379e7Schristosset LANG=ru_RU.CP878 61*946379e7Schristos 62*946379e7Schristosor (same effect): 63*946379e7Schristos 64*946379e7Schristosset LANG=ru_RU.IBM-878 65*946379e7Schristos 66*946379e7SchristosIf the output character set is ommited from the LANG variable, the default 67*946379e7Schristoscodepage is ALWAYS taken from the operating system (e.g. the codepage setting 68*946379e7Schristosfrom locale.alias is always ignored, so "russian" stays just for "ru_RU" and 69*946379e7Schristosnot for "ru_RU.ISO-8859-5"); you may want to set it just if you want to 70*946379e7Schristosoverride the active OS/2 codepage. 71*946379e7Schristos 72*946379e7Schristos 73*946379e7SchristosXFree86 setup 74*946379e7Schristos============= 75*946379e7Schristos 76*946379e7SchristosIf you use XFree86 and the OS/2 default character set is different from the 77*946379e7SchristosXFree86 default character set (e.g. for Russain CP866 vs KOI8-R), you can add 78*946379e7Schristosthe following (or similar) statement to your startx.cmd file (after the 79*946379e7Schristoscommands dealing with HOME and X11SHELL): 80*946379e7Schristos 81*946379e7Schristoscall VALUE 'LANG', 'ru_RU.KOI8-R', env 82*946379e7Schristos 83*946379e7SchristosOtherwise you can get incorrect (wrong codepage) output from programs that 84*946379e7Schristospreviously worked (e.g. GIMP 1.22). This is because earlier versions of gettext 85*946379e7Schristosdidn't support character set translations. 86*946379e7Schristos 87*946379e7Schristos 88*946379e7SchristosImplementation remarks 89*946379e7Schristos====================== 90*946379e7Schristos 91*946379e7SchristosThe codepage conversion code uses OS/2 Unicode API, thus it falls under the 92*946379e7Schristoslimits that OS/2 Unicode API has. For example, OS/2 Unicode API does not 93*946379e7Schristossupport the BIG5 East Asian character set nor ISO-8859-X where X > 9 (at 94*946379e7Schristosleast with Warp4 with fixpack 14 that I have). If someone knows the 95*946379e7SchristosOS/2 API identifiers for BIG5 or ISO8859-10,... encodings, please tell me! 96*946379e7Schristos 97*946379e7SchristosSince gettext 0.11 iconv emulation layer supports correctly UTF-8. Also 98*946379e7SchristosI have added theoretical support for the following East Asian encodings: 99*946379e7SchristosEUC-JP, EUC-KR, EUC-TW, EUC-CN. However, these encodings are (I believe) 100*946379e7Schristossupported only on East Asian editions of OS/2. The code pages for them are 101*946379e7Schristoslisted in the \language\codepage\ucstbl.lst file but the codepage files 102*946379e7Schristosthemselves are missing; I believe they are ommited from European OS/2's 103*946379e7Schristosdue to their large size. 104*946379e7Schristos 105*946379e7SchristosAlso I have added "support" for the BIG5 codeset as an alias for IBM-950 106*946379e7Schristoscodepage. However, I'm not very sure about this; in any case OS/2 does not 107*946379e7Schristossupport (as far as I know) anything closer to BIG5. 108*946379e7Schristos 109*946379e7Schristos 110*946379e7SchristosAdditional API 111*946379e7Schristos============== 112*946379e7Schristos 113*946379e7SchristosThis package provides additionaly the iconv() API that can be used by 114*946379e7Schristosdevelopers for doing more feature-full Unix ports. The iconv() API is used 115*946379e7Schristosto convert text between various codepages. The intl.h header file contains 116*946379e7Schristosthe prototypes and definitions needed for iconv(); if you configure software 117*946379e7Schristoswith autoconf it possibly will find intl.h and set up the software accordingly. 118*946379e7Schristos 119*946379e7SchristosAll these functions are exported from INTL.DLL. The iconv.a import library 120*946379e7Schristosimports all the iconv* functions from INTL.DLL. So, like on Unix, now you can 121*946379e7Schristos#include <iconv.h>, then link with -liconv and you will get a fully functional 122*946379e7Schristosiconv implementation. 123*946379e7Schristos 124*946379e7Schristos 125*946379e7SchristosRebuilding the library 126*946379e7Schristos====================== 127*946379e7Schristos 128*946379e7SchristosThe library is quite easy to rebuild. Since the OS/2 support is provided now 129*946379e7Schristosout-of-the-box in gettext, you just have to download and unpack the source 130*946379e7Schristosarchive. Now there are two ways to rebuild the gettext library: 131*946379e7Schristos 132*946379e7Schristos1. If you're a masochist you can go the clumsy configure/make Unix way. This 133*946379e7Schristosis not recommended however as I found no way to tell libtool to generate a 134*946379e7Schristosslightly non-standard DLL which will be backward compatible with gettext 135*946379e7Schristos0.10.35. The compatibility is achieved by prepending backward.def to the 136*946379e7Schristosexport definition file generated with emximp or somehow else. Thus it is 137*946379e7Schristoshighly recommended you build using the second way, if it is possible. 138*946379e7Schristos 139*946379e7Schristos2. Go to os2 and just run `make'. If you have all the required tools, 140*946379e7Schristosit should painlessly compile. Finally, if you want a binary distribution 141*946379e7Schristosarchive, do `make distr'. The weak side of building this way is that makefile 142*946379e7Schristosis somewhat fragile. This means that if the makefile is left unmodified and 143*946379e7Schristosa new version of gettext is rolled out, it *may* not work. But every possible 144*946379e7Schristosattempt was made to ensure that the makefile takes most important build 145*946379e7Schristosparameters from their autoconf counterparts. 146*946379e7Schristos 147*946379e7SchristosWARNING: Due to bugs in GNU Make 3.76.1 (at least in its OS/2 port) you can 148*946379e7Schristosget sometimes (depending on make version and makefile modification :) funny 149*946379e7Schristosmessages like these: 150*946379e7Schristos 151*946379e7Schristoszip warning: name not matched: emx/src/gettext-0.10.40/support/os2/iconv.h 152*946379e7Schristos 153*946379e7Schristosor even: 154*946379e7Schristos 155*946379e7Schristos*** No rule to make target `out/release/intl.a', needed by `all'. Stop. 156*946379e7Schristos 157*946379e7SchristosSuch messages are a bad joke. Ignore it, and re-run make. This is a 158*946379e7Schristoslong-standing bug in GNU make, alas. 159*946379e7Schristos 160*946379e7SchristosIf you want a debug version of library, you can do `make DEBUG=1'. 161*946379e7Schristos 162*946379e7SchristosIf you don't have the LxLite tool installed, do `make LXLITE=0' 163*946379e7Schristos 164*946379e7SchristosNB: For best results, it is highly recommended that you use at least emxbind.exe 165*946379e7Schristosand ld.exe from gcc 3.0.2 or later, since they contain a number of fixes that 166*946379e7Schristoswill help you generate a more optimal DLL. 167*946379e7Schristos 168*946379e7Schristos 169*946379e7SchristosContributors 170*946379e7Schristos============ 171*946379e7Schristos 172*946379e7SchristosHung-Chi Chu <hcchu@r350.ee.ntu.edu.tw> 173*946379e7Schristos the original port of gettext (0.10.35) 174*946379e7Schristos 175*946379e7SchristosJun SAWATAISHI <jsawa@attglobal.net> 176*946379e7Schristos some more work on it and submitted the patches to GNU team, although 177*946379e7Schristos they were not completely integrated. 178*946379e7Schristos 179*946379e7SchristosAndrew Zabolotny <zap@cobra.ru> 180*946379e7Schristos Succeeded to remove almost all OS/2-specific #ifdef's from mainstream 181*946379e7Schristos source code, wrote the dedicated OS/2 makefile, wrote the iconv wrapper 182*946379e7Schristos around OS/2 Unicode API, added support for locale translations. 183