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