aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/handbook/l10n/chapter.sgml
blob: da83fe2442ba3bd7e0c627f49943481eacb2e777 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!--
     The FreeBSD Documentation Project

     $FreeBSD$
-->

<chapter id="l10n">
  <title>Localization</title>
  
  <sect1 id="russian">
    <title>Russian Language (KOI8-R encoding)</title>
    
    <para><emphasis>Contributed by &a.ache;  1 May
	1997</emphasis>.</para>
    
    <para>See more info about KOI8-R encoding at <ulink
	url="http://www.nagual.pp.ru/~ache/koi8.html">KOI8-R References
	(Russian Net Character Set)</ulink>.</para>
    
    <sect2 id="russian-console">
      <title>Console Setup</title>
      
      <procedure>
	<step>
	  <para>Add following line to your kernel configuration file:
	    
	    <programlisting>
options         "SC_MOUSE_CHAR=0x03"</programlisting>

	    to move character codes used for mouse cursor off KOI8-R
	    pseudographics range.</para>
	</step>
	
	<step>
	  <para>Russian console entry in
	    <filename>/etc/rc.conf</filename> should looks like:</para>
		  
	  <programlisting>
keymap=ru.koi8-r
keychange="61 ^[[K"
scrnmap=koi8-r2cp866
font8x16=cp866b-8x16
font8x14=cp866-8x14
font8x8=cp866-8x8</programlisting>

	  <note>
	    <para>^[ means that real ESC character must be entered into
	      <filename>/etc/rc.conf</filename>, not just ^[ string.</para>
	  </note>
	  
	  <para>This tuning means KOI8-R keyboard with Alternative screen font
	    mapped to KOI8-R encoding to preserve pseudographics,
	    <literal>Gray Delete</literal> key remapped to match Russian
	      &man.termcap.5; entry for
	    FreeBSD console.</para>
	  
	  <para>RUS/LAT switch will be <literal>CapsLock</literal>.  Old
	    CapsLock function still available via
	    <literal>Shift+CapsLock</literal>. CapsLock LED will indicate RUS
	    mode, not CapsLock mode.</para>
	</step>
	
	<step>
	  <para>For each <literal>ttyv?</literal> entry in
	    <filename>/etc/ttys</filename> change terminal type from
	    <literal>cons25</literal> to <literal>cons25r</literal>, i.e. each
	    entry should looks like:</para>
	  
	  <programlisting>
ttyv0	"/usr/libexec/getty Pc"        cons25r	on  secure</programlisting>
	</step>
      </procedure>
    </sect2>
    
    <sect2 id="russian-locale">
      <title>Locale Setup</title>
      
      <para><anchor id="russian-env"> There is two environment variables
	for locale setup:</para>
      
      <itemizedlist>
	<listitem>
	  <para><envar>LANG</envar> for POSIX &man.setlocale.3; family
	    functions;</para>
	</listitem>
	
	<listitem>
	  <para><envar>MM_CHARSET</envar> for applications MIME character
	    set.</para>
	</listitem>
      </itemizedlist>
      
      <para>The best way is using <filename>/etc/login.conf</filename>
	<literal>russian</literal> user's login class in
	  &man.passwd.5; entry login class position.  See &man.login.conf.5;
	for details.</para>
      
      <sect3 id="russian-class">
	<title>Login Class Method</title>
	
	<para>First of all check your <filename>/etc/login.conf</filename>
	  have <literal>russian</literal> login class, this entry may looks
	  like:</para>
	
	<programlisting>
russian:Russian Users Accounts:\
        :charset=KOI8-R:\
        :lang=ru_RU.KOI8-R:\
        :tc=default:</programlisting>
	
	<sect4>
	  <title>How to do it with &man.vipw.8;</title>
	  
	  <para>If you use &man.vipw.8; for adding new users,
	    <filename>/etc/master.passwd</filename> entry should looks
	    like:</para>

	  <programlisting>
user:password:1111:11:russian:0:0:User Name:/home/user:/bin/csh</programlisting>
	</sect4>
	
	<sect4>
	  <title>How to do it with &man.adduser.8;</title>
	  
	  <para>If you use &man.adduser.8; for adding new users:</para>
	  
	  <itemizedlist>
	    <listitem>
	      <para>Set
		
		<programlisting>
defaultclass = russian</programlisting>

		in <filename>/etc/adduser.conf</filename> (you must enter
		<literal>default</literal> class for all non-Russian users in
		this case);</para>
	    </listitem>
	    
	    <listitem>
	      <para>Alternative variant will be answering
		<literal>russian</literal> each time when you see

		<screen><prompt>Enter login class:</prompt> default []:</screen>
		prompt from &man.adduser.8;;</para>
	    </listitem>
	    
	    <listitem>
	      <para>Another variant: call
		
		<screen>&prompt.root; <userinput>adduser -class russian</userinput></screen>

		for each Russian user you want to add.</para>
	    </listitem>
	  </itemizedlist>
	</sect4>
	
	<sect4>
	  <title>How to do it with &man.pw.8;</title>
	  
	  <para>If you use &man.pw.8; for adding new users, call it in this
	    form:</para>
		
	  <screen>&prompt.root; <userinput>pw useradd user_name -L russian</userinput></screen>
	</sect4>
      </sect3>
      
      <sect3>
	<title>Shell Startup Files Method</title>
	
	<para>If you don't want to use <link linkend="russian-class">login
	    class method</link> for some reasons, just set this <link
	    linkend="russian-env">two environment variables</link> in the
	  following shell startup files:</para>
	
	<itemizedlist>
	  <listitem>
	    <para><filename>/etc/profile</filename>:</para>
	    
	    <programlisting>
LANG=ru_RU.KOI8-R; export LANG
MM_CHARSET=KOI8-R; export MM_CHARSET</programlisting>
	  </listitem>
	  
	  <listitem>
	    <para><filename>/etc/csh.login</filename>:</para>
	    
	    <programlisting>
setenv LANG ru_RU.KOI8-R
setenv MM_CHARSET KOI8-R</programlisting>
	  </listitem>
	</itemizedlist>
	
	<para>Alternatively you can add this instructions to</para>

	<itemizedlist>
	  <listitem>
	    <para><filename>/usr/share/skel/dot.profile</filename>:</para>
	    
	    <para>(similar to <filename>/etc/profile</filename> above);</para>
	  </listitem>
	  
	  <listitem>
	    <para><filename>/usr/share/skel/dot.login</filename>:</para>
	    
	    <para>(similar to <filename>/etc/csh.login</filename>
	      above).</para>
	  </listitem>
	</itemizedlist>
      </sect3>
    </sect2>
    
    <sect2 id="russian-printer">
      <title>Printer Setup</title>
      
      <para>Since most printers with Russian characters comes with hardware
	code page CP866, special output filter needed for KOI8-R -&gt; CP866
	conversion.  Such filter installed by default as
	<filename>/usr/libexec/lpr/ru/koi2alt</filename>.  So, Russian printer
	<filename>/etc/printcap</filename> entry should looks like:</para>

      <programlisting>
lp|Russian local line printer:\
        :sh:of=/usr/libexec/lpr/ru/koi2alt:\
        :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:</programlisting>

      <para>See &man.printcap.5; for detailed description.</para>
    </sect2>
    
    <sect2 id="russian-msdosfs">
      <title>MSDOS FS and Russian file names</title>
      
      <para>Look at following example &man.fstab.5; entry to enable support
	for Russian file names in MSDOS FS:</para>
      
      <programlisting>
/dev/sd0s1        /dos/c    msdos   rw,-W=koi2dos,-L=ru_RU.KOI8-R 0 0</programlisting>

      <para>See &man.mount.msdos.8; for detailed description of
	<option>-W</option> and <option>-L</option> options.</para>
    </sect2>
    
    <sect2 id="russian-xwindow">
      <title>X Window Setup</title>
      
      <para>Step by step instructions:</para>
      
      <procedure>
	<step>
	  <para>Do <link linkend="russian-locale">non-X locale setup</link>
	    first as described.</para>
	  
	  <note>
	    <para><anchor id="russian-note">Russian KOI8-R locale may not work
	      with old XFree86 releases (lower than 3.3). XFree86 port from
	      <filename>/usr/ports/x11/XFree86</filename> already have most
	      recent XFree86 version, so it will work, if you install XFree86
	      from this port.  XFree86 version shipped with the latest FreeBSD
	      distribution should work too (check XFree86 version number not
	      less than 3.3 first).</para>
	  </note>
	</step>
	
	<step>
	  <para>Go to <filename>/usr/ports/russian/X.language</filename>
	    directory and say
	    
	    <screen>&prompt.root; <userinput>make all install</userinput></screen>
	    there.  This port install latest version of KOI8-R fonts.  XFree86
	    3.3 already have some KOI8-R fonts, but this ones scaled
	    better.</para>
		
	  <para>Check find <literal>"Files"</literal> section in your
	    <filename>/etc/XF86Config</filename>, following lines must be
	    before any other <literal>FontPath</literal> entries:</para>

	  <programlisting>
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/misc"
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi"
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"</programlisting>
	  
	  <para>If you use high resolution video mode, swap 75 dpi and 100 dpi
	    lines.</para>
	</step>
	
	<step>
	  <para>To activate Russian keyboard add
	    
	    <programlisting>
XkbKeymap   "xfree86(ru)"</programlisting>

	    line into <literal>"Keyboard"</literal> section in your
	    <filename>/etc/XF86Config</filename>, also make sure that
	    <literal>XkbDisable</literal> is turned off (commented out)
	    there.</para>
		
	  <para>RUS/LAT switch will be <literal>CapsLock</literal>.  Old
	    CapsLock function still available via
	    <literal>Shift+CapsLock</literal> (in LAT mode only).</para>

	  <note>
	    <para>Russian XKB keyboard may not work with old XFree86 versions,
	      see <link linkend="russian-note">locale note</link> for more
	      info. Russian XKB keyboard may not work with non-localized
	      applications too, minimally localized application should call
	      <literal>XtSetLanguageProc (NULL, NULL, NULL);</literal>
	      function early in the program.</para>
	  </note>
	</step>
      </procedure>
    </sect2>
  </sect1>
  
  <sect1 id="german">
    <title>German Language (ISO 8859-1)</title>
    
    <para>Slaven Rezic <email>eserte@cs.tu-berlin.de</email> wrote a tutorial
      how to use umlauts on a FreeBSD machine.  The tutorial  is written in
      German and available at <ulink
	url="http://www.de.FreeBSD.org/de/umlaute/">http://www.de.FreeBSD.org/de/umlaute/</ulink>.</para>
  </sect1>
</chapter>

<!-- 
     Local Variables:
     mode: sgml
     sgml-declaration: "../chapter.decl"
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     sgml-parent-document: ("../book.sgml" "part" "chapter")
     End:
-->