aboutsummaryrefslogtreecommitdiff
path: root/zh_TW.UTF-8/books/developers-handbook/l10n/chapter.xml
blob: 548fd08e3a5d0bb792f5b2222901b9f0bbfb23d7 (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
<?xml version="1.0" encoding="utf-8"?>
<!--
     The FreeBSD Documentation Project

     $FreeBSD$
-->
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="l10n">
    <title>Localization and Internationalization - L10N and I18N</title>

    <sect1 xml:id="l10n-programming">
      <title>Programming I18N Compliant Applications</title>
      <indexterm><primary>Qt</primary></indexterm>
      <indexterm><primary>GTK</primary></indexterm>
      <para>To make your application more useful for speakers of other
	languages, we hope that you will program I18N compliant.  The GNU
	gcc compiler and GUI libraries like QT and GTK support I18N through
	special handling of strings.  Making a program I18N compliant is
	very easy.  It allows contributors to port your application to
	other languages quickly.  Refer to the library specific I18N
	documentation for more details.</para>

      <para>In contrast with common perception, I18N compliant code is
	easy to write.  Usually, it only involves wrapping your strings
	with library specific functions.  In addition, please be sure to
	allow for wide or multibyte character support.</para>

      <sect2>
	<title>A Call to Unify the I18N Effort</title>

	<para>It has come to our attention that the individual I18N/L10N
	  efforts for each country has been repeating each others'
	  efforts.  Many of us have been reinventing the wheel repeatedly
	  and inefficiently.  We hope that the various major groups in
	  I18N could congregate into a group effort similar to the Core
	  Team's responsibility.</para>

	<para>Currently, we hope that, when you write or port I18N
	  programs, you would send it out to each country's related
	  FreeBSD mailing list for testing.  In the future, we hope to
	  create applications that work in all the languages
	  out-of-the-box without dirty hacks.</para>

	<para>The &a.i18n; has been established.  If you are an I18N/L10N
	  developer, please send your comments, ideas, questions, and
	  anything you deem related to it.</para>
      </sect2>

      <sect2>
	<title>Perl and Python</title>
        <indexterm>
         <primary>Perl</primary>
        </indexterm>
        <indexterm>
          <primary>Python</primary>
        </indexterm>

	<para>Perl and Python have I18N and wide character handling
	  libraries.  Please use them for I18N compliance.</para>

	<para>In older FreeBSD versions,
	  Perl may give warnings about not having a wide character locale
	  installed on your system.  You can set the
	  environment variable <envar>LD_PRELOAD</envar> to
	  <filename>/usr/lib/libxpg4.so</filename> in your shell.</para>

	<para>In <literal>sh</literal>-based shells:</para>

	<programlisting><envar>LD_PRELOAD=/usr/lib/libxpg4.so</envar></programlisting>

	<para>In <literal>C</literal>-based shells:</para>

	<programlisting><envar>setenv LD_PRELOAD /usr/lib/libxpg4.so</envar></programlisting>
      </sect2>
    </sect1>
</chapter>