1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-27 17:02:33 +01:00
Files
wmaker/doc/build/Translations.texi
Christophe CURIS f222a319b1 configure: rewrote the support for option '--with-menu-textdomain'
The idea is to include consistency check to warn the user if he is not
using it properly, instead of silently misbehaving;

Updated code style to use Autoconf macros for consistency.

Took opportunity to remove the hacky setting inside 'config-paths.h' where
it is a bit out of place, in favour of a standard DEFINE in the 'config.h'.

Include in the i18n documentation the explanation on how Window Maker
translates the menus, both when the 'menu-textdomain' option is used and
when it is not.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00

233 lines
8.4 KiB
Plaintext

\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename wmaker_i18n.info
@settitle Window Maker Internationalisation 1.0
@c %**end of header
@c This documentation is written in Texinfo format:
@c https://www.gnu.org/software/texinfo/manual/texinfo/
@c
@c The reference checker is the GNU texi2any tool, which can be invoked like this:
@c texi2any --plaintext --no-split --verbose Translations.texi
@c
@c If you modify this file, you may want to spell-check it with:
@c aspell --lang=en_GB --mode=texinfo check Translations.texi
@c
@c The length of lines in this file is set to 100 because it tends to keep sentences together
@c despite the embedded @commands{};
@c
@c It is generally considered good practice for Tex and Texinfo formats to keep sentences on
@c different lines, using the fact that in the end they will be merged in paragraph anyway, because
@c it makes the patchs clearer about where the changes actually are.
@finalout
@set version git#next
@c ---------------------------------------------------------------------------------- Title Page ---
@copying
@noindent
This manual is for @sc{Window Maker} window manager, version @value{version}.
@noindent Copyright @copyright{} 2015 The Window Maker Team.
@quotation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program, see file COPYING for details.
@end quotation
@end copying
@titlepage
@title Window Maker Internationalisation
@subtitle A guide to enable support for language translations
@subtitle in @sc{Window Maker}.
@author Christophe CURIS
@page
@vskip 0pt plus 1filll
@insertcopying
@sp 1
Published by The Window Maker team on @today{}.
@end titlepage
@c ---------------------------------------------------------------------------- Table of Content ---
@node Top
@ifnottex
@top Window Maker Internationalisation
A guide to enable support for language translations
in @sc{Window Maker}.
@end ifnottex
@contents
@ifnottex
@sp 1
This manual is for Window Maker, version @value{version}.
@end ifnottex
@menu
* Enabling Languages support:: How to compile Window Maker with i18n support
* Choosing the Language:: When installed, how to run wmaker with your language
@end menu
@c ------------------------------------------------------------------ Enabling Languages support ---
@node Enabling Languages support
@chapter Enabling Languages support
@sc{Window Maker} has the possibility to be translated in many languages, but by default none of
them will be installed, and the support for translation will not be compiled.
To enable the translation capabilities, you have to specify which language(s) you want to be
installed: this is done with the variable @env{LINGUAS} when running the @command{configure} script.
This variable should contain the space-separated list of languages you want to install.
You could for instance enable both French (@code{fr}) and Dutch (@code{nl}) with this:
@example
./configure LINGUAS="fr nl"
@end example
You can of course add any other option that you want to the @command{configure} command.
From the moment you specify the variable, the @command{configure} script will check that you have
the appropriate dependencies for this (basically the @code{gettext} function and the @code{libintl}
library); when you run @command{make} to compile the project, it will also compile the translation
(@code{mo} files) for the language(s) you asked (if available, of course), and during
@command{make install} it will install them in the usual directory.
The installation directory can be changed with the standard option @option{--localedir} to the
@command{configure} script, the default path being
@file{@emph{<prefix>}/share/locale/@emph{<lang>}/LC_MESSAGES}).
@c ---------------------------------------------------------------------- Translations for Menus ---
@section Translations for Menus
In order to propose an @emph{Application Menu} (also called @emph{Root Menu}) that is also
translated in the language of the interface, @sc{Window Maker} implements two complementary
mechanisms:
The first, always enabled when i18n support is enabled, is to look for the menu file containing the
name of the locale.
For example, if the file is called @file{menu} and the language is set as @env{LANG=fr_FR.utf-8},
then @sc{Window Maker} will search for, and use the first match found:
@itemize
@item @code{menu.fr_FR.utf-8}
@item @code{menu.fr_FR}
@item @code{menu.fr}
@item @code{menu}
@end itemize
The second possibility, which is not enabled by default, is to be able to use a custom @file{po}
file which contains the translations for the text of the menu.
This feature is enabled at compile time, using the option @option{--with-menu-textdomain} to the
@command{configure} script. For example, if you specify:
@example
./configure --with-menu-textdomain=WMMenu
@end example
@noindent then the translations for the menu will be searched in the file @file{WMMenu.mo} located
at the standard location, the default path being
@file{@emph{<prefix>}/share/locale/@emph{<lang>}/LC_MESSAGES/@emph{WMMenu}.mo}.
If you do not enable the feature (the default behaviour, or with an explicit
@option{--without-menu-textdomain}), then @sc{Window Maker} will @b{not} try to translate the
strings, even using its own domain file (@file{WindowMaker.mo}).
@c --------------------------------------------------------------------- LINGUAS at system level ---
@section Setting @env{LINGUAS} at system level
As the variable @env{LINGUAS} is quite standard, you also have the possibility to set its value in
the @file{config.site} file for @sc{Autoconf}.
This file can be placed in one of these paths:
@itemize @bullet
@item @file{@emph{<prefix>}/share/config.site}
@item @file{@emph{<prefix>}/etc/config.site}
@end itemize
This way, the same language list will be used for all the programs that use @sc{Autoconf} that you
would compile.
Please note that if you also specify a value on the command line, it will have precedence over the
value in that file.
@c ----------------------------------------------------------------------- Choosing the Language ---
@node Choosing the Language
@chapter Choosing the Language
If you have compiled and installed @sc{Window Maker} with support for your language,
the effective translation is done is the very same way as any other application on an @sc{Unix}
system, you just have to set the shell variable @env{LANG} to your language before @command{wmaker}
is started.
In @command{sh} type of shell (@sc{sh}, @sc{ksh}, @sc{bash}, ...), this is done for example with
(@code{fr} is for French):
@example
export LANG=fr
@end example
There is also a command line option @option{--locale} for @sc{Window Maker} which may be used to set
the language:
@example
wmaker --locale fr
@end example
When using this option, @sc{Window Maker} will use the locale you specified, redefining the
@env{LANG} environment variable to this value so all program started from @sc{Window Maker} will
inherit its value.
If your system is using @sc{systemd}, you can also configure the locale at system level using the
command:
@example
localectl set-locale LANG=fr
@end example
You can check if the current value is properly supported with the command:
@example
locale
@end example
If this does not work, you may need first to activate the support for your locale in the system;
you can get the list of currently enabled locales with the command:
@example
locale -a
@end example
You should be able to enable a new language support by editing the file @file{/etc/locale.gen} to
uncomment the locale(s) you need (by removing the @code{#} character and space(s) in front of it,
and by running the command @command{locale-gen} as root.
For further information, you may wish to read dedicated documentation, for example from
@uref{http://tldp.org/HOWTO/HOWTO-INDEX/other-lang.html, the Linux Documentation Project}
or through pages like
@uref{http://www.shellhacks.com/en/HowTo-Change-Locale-Language-and-Character-Set-in-Linux,Shell Hacks' note on Changing Locale}.
@c ------------------------------------------------------------------------------------- The End ---
@bye