Home | History | Annotate | Line # | Download | only in doc
      1 The @code{gettextize} program is an interactive tool that helps the
      2 maintainer of a package internationalized through GNU @code{gettext}.
      3 It is used for two purposes:
      4 
      5 @itemize @bullet
      6 @item
      7 As a wizard, when a package is modified to use GNU @code{gettext} for
      8 the first time.
      9 
     10 @item
     11 As a migration tool, for upgrading the GNU @code{gettext} support in
     12 a package from a previous to a newer version of GNU @code{gettext}.
     13 @end itemize
     14 
     15 This program performs the following tasks:
     16 
     17 @itemize @bullet
     18 @item
     19 It copies into the package some files that are consistently and
     20 identically needed in every package internationalized through
     21 GNU @code{gettext}.
     22 
     23 @item It performs as many of the tasks mentioned in the next section
     24 @ref{Adjusting Files} as can be performed automatically.
     25 
     26 @item It removes obsolete files and idioms used for previous GNU
     27 @code{gettext} versions to the form recommended for the current GNU
     28 @code{gettext} version.
     29 
     30 @item It prints a summary of the tasks that ought to be done manually
     31 and could not be done automatically by @code{gettextize}.
     32 @end itemize
     33 
     34 It can be invoked as follows:
     35 
     36 @pindex gettextize
     37 @cindex @code{gettextize} program, usage
     38 @example
     39 gettextize [ @var{option}@dots{} ] [ @var{directory} ]
     40 @end example
     41 
     42 @noindent
     43 and accepts the following options:
     44 
     45 @table @samp
     46 @item -f
     47 @itemx --force
     48 @opindex -f@r{, @code{gettextize} option}
     49 @opindex --force@r{, @code{gettextize} option}
     50 Force replacement of files which already exist.
     51 
     52 @item --intl
     53 @opindex --intl@r{, @code{gettextize} option}
     54 Install the libintl sources in a subdirectory named @file{intl/}.
     55 This libintl will be used to provide internationalization on systems
     56 that don't have GNU libintl installed.  If this option is omitted,
     57 the call to @code{AM_GNU_GETTEXT} in @file{configure.in} should read:
     58 @samp{AM_GNU_GETTEXT([external])}, and internationalization will not
     59 be enabled on systems lacking GNU gettext.
     60 
     61 @item --no-changelog
     62 @opindex --no-changelog@r{, @code{gettextize} option}
     63 Don't update or create ChangeLog files.  By default, @code{gettextize}
     64 logs all changes (file additions, modifications and removals) in a
     65 file called @samp{ChangeLog} in each affected directory.
     66 
     67 @item --symlink
     68 @opindex --symlink@r{, @code{gettextize} option}
     69 Make symbolic links instead of copying the needed files.  This can be
     70 useful to save a few kilobytes of disk space, but it requires extra
     71 effort to create self-contained tarballs, it may disturb some mechanism
     72 the maintainer applies to the sources, and it is likely to introduce
     73 bugs when a newer version of @code{gettext} is installed on the system.
     74 
     75 @item -n
     76 @itemx --dry-run
     77 @opindex -d@r{, @code{gettextize} option}
     78 @opindex --dry-run@r{, @code{gettextize} option}
     79 Print modifications but don't perform them.  All actions that
     80 @code{gettextize} would normally execute are inhibited and instead only
     81 listed on standard output.
     82 
     83 @item --help
     84 @opindex --help@r{, @code{gettextize} option}
     85 Display this help and exit.
     86 
     87 @item --version
     88 @opindex --version@r{, @code{gettextize} option}
     89 Output version information and exit.
     90 
     91 @end table
     92 
     93 If @var{directory} is given, this is the top level directory of a
     94 package to prepare for using GNU @code{gettext}.  If not given, it
     95 is assumed that the current directory is the top level directory of
     96 such a package.
     97 
     98 The program @code{gettextize} provides the following files.  However,
     99 no existing file will be replaced unless the option @code{--force}
    100 (@code{-f}) is specified.
    101 
    102 @enumerate
    103 @item
    104 The @file{ABOUT-NLS} file is copied in the main directory of your package,
    105 the one being at the top level.  This file gives the main indications
    106 about how to install and use the Native Language Support features
    107 of your program.  You might elect to use a more recent copy of this
    108 @file{ABOUT-NLS} file than the one provided through @code{gettextize},
    109 if you have one handy.  You may also fetch a more recent copy of file
    110 @file{ABOUT-NLS} from Translation Project sites, and from most GNU
    111 archive sites.
    112 
    113 @item
    114 A @file{po/} directory is created for eventually holding
    115 all translation files, but initially only containing the file
    116 @file{po/Makefile.in.in} from the GNU @code{gettext} distribution
    117 (beware the double @samp{.in} in the file name) and a few auxiliary
    118 files.  If the @file{po/} directory already exists, it will be preserved
    119 along with the files it contains, and only @file{Makefile.in.in} and
    120 the auxiliary files will be overwritten.
    121 
    122 @item
    123 Only if @samp{--intl} has been specified:
    124 A @file{intl/} directory is created and filled with most of the files
    125 originally in the @file{intl/} directory of the GNU @code{gettext}
    126 distribution.  Also, if option @code{--force} (@code{-f}) is given,
    127 the @file{intl/} directory is emptied first.
    128 
    129 @item
    130 The file @file{config.rpath} is copied into the directory containing
    131 configuration support files.  It is needed by the @code{AM_GNU_GETTEXT}
    132 autoconf macro.
    133 
    134 @item
    135 Only if the project is using GNU @code{automake}:
    136 A set of @code{autoconf} macro files is copied into the package's
    137 @code{autoconf} macro repository, usually in a directory called @file{m4/}.
    138 @end enumerate
    139 
    140 If your site support symbolic links, @code{gettextize} will not
    141 actually copy the files into your package, but establish symbolic
    142 links instead.  This avoids duplicating the disk space needed in
    143 all packages.  Merely using the @samp{-h} option while creating the
    144 @code{tar} archive of your distribution will resolve each link by an
    145 actual copy in the distribution archive.  So, to insist, you really
    146 should use @samp{-h} option with @code{tar} within your @code{dist}
    147 goal of your main @file{Makefile.in}.
    148 
    149 Furthermore, @code{gettextize} will update all @file{Makefile.am} files
    150 in each affected directory, as well as the top level @file{configure.in}
    151 or @file{configure.ac} file.
    152 
    153 It is interesting to understand that most new files for supporting
    154 GNU @code{gettext} facilities in one package go in @file{intl/},
    155 @file{po/} and @file{m4/} subdirectories.  One distinction between
    156 @file{intl/} and the two other directories is that @file{intl/} is
    157 meant to be completely identical in all packages using GNU @code{gettext},
    158 while the other directories will mostly contain package dependent
    159 files.
    160 
    161 The @code{gettextize} program makes backup files for all files it
    162 replaces or changes, and also write ChangeLog entries about these
    163 changes.  This way, the careful maintainer can check after running
    164 @code{gettextize} whether its changes are acceptable to him, and
    165 possibly adjust them.  An exception to this rule is the @file{intl/}
    166 directory, which is added or replaced or removed as a whole.
    167 
    168 It is important to understand that @code{gettextize} can not do the
    169 entire job of adapting a package for using GNU @code{gettext}.  The
    170 amount of remaining work depends on whether the package uses GNU
    171 @code{automake} or not.  But in any case, the maintainer should still
    172 read the section @ref{Adjusting Files} after invoking @code{gettextize}.
    173 
    174 In particular, if after using @samp{gettexize}, you get an error
    175 @samp{AC_COMPILE_IFELSE was called before AC_GNU_SOURCE} or
    176 @samp{AC_RUN_IFELSE was called before AC_GNU_SOURCE}, you can fix it
    177 by modifying @file{configure.ac}, as described in @ref{configure.in}.
    178 
    179 It is also important to understand that @code{gettextize} is not part
    180 of the GNU build system, in the sense that it should not be invoked
    181 automatically, and not be invoked by someone who doesn't assume the
    182 responsibilities of a package maintainer.  For the latter purpose, a
    183 separate tool is provided, see @ref{autopoint Invocation}.
    184