Internationalization and Localization (GSoC 2011)
Summary
The goal of this project:
1. NTP utilities' i18n support, all programs in NTP will be ready to localization, that's, if we want NTP to support a new language, we won't need to change the program any more;
2. clear and simple data interface for localization, that is, a well arranged string list which covers the programs' output and man page and web pages, with as less redundancy as possible;
3. at least two language(non-English)'s localization of the above data; one is Chinese(my native language), the other will be selected after the goal 2 is done; I choose two here just for better testing goal 1 and goal 2;
Related Items:
Timeline
Discussion and Comments
Possible Implementation Ideas
Right now, we might have something like:
doc-section = {
ds-type = 'USAGE';
ds-format = 'mdoc';
ds-text = <<- _END_MDOC_USAGE
blah
_END_MDOC_USAGE;
};
How should we handle different languages with this?
Would
ds-text-
be a good choice?
We could put the languages one after another:
doc-section = {
ds-type = 'USAGE';
ds-format = 'mdoc';
ds-text = <<- _END_MDOC_USAGE
blah
_END_MDOC_USAGE;
ds-text-zh_CN.GB2312 = <<- _END_MDOC_USAGE
blah
_END_MDOC_USAGE;
};
Or we could try a
#include
syntax:
doc-section = {
ds-type = 'USAGE';
ds-format = 'mdoc';
#include ds-text-$LC_AGEN.usage
};
where
ds-text-zh_CN.GB2312.usage
might contain
ds-text-zh_CN.GB2312 = <<- _END_MDOC_USAGE
blah
_END_MDOC_USAGE;
Harlan notes that some might prefer
#include ds-text-usage.$LC_AGEN
instead, and that's fine - it's a "policy" choice, and he is interested in making sure we have a good "mechanism" here.
autogen
might treat
$LC_AGEN
as slightly magical - if no value for
$LG_AGEN
is specified, we might see if there is a value for
$LC_ALL
(for example) and use that instead. And it should not be a fatal error if the requested "translation file" does not exist; in that case the base
ds-text
stanza would be used.
Naming Output Files
Some folks will want to
generate more than 1 (likely all) locale's worth of output files. This will probably require a
for
loop in the
Makefile.am
and we will need to choose a naming convention for the generated files. We may also want a way to
install a subset of these files.
Comments