[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i18n
From: |
Paul Kienzle |
Subject: |
i18n |
Date: |
Tue, 15 Jun 2004 19:15:31 -0400 |
On Jun 15, 2004, at 2:27 PM, Tomasv wrote:
- Translate software and documentation to spanish and portugues
There is no work done on i18n for octave.
Many tutorials exist already on the net. Finding a good set and
linking to them from http://wiki.octave.org would be useful.
If you wanted to maintain a portuguese or spanish version of the
documentation, you could store it in octave-forge. Or you could
store it at http://wiki.octave.org so that users can add to it when
they need to.
For the function descriptions, it is easy to replace help() so that it
first looks for language specific help in a separate set of directories,
or looks for help in the usual way if no translation exists.
Making error messages to appear in your own language is harder.
All messages go through error() and warning(). You can add
a hash table loaded at runtime (Map lang<string,string>) depending
on the environment variable LANG. error and warning can look up
each message and use a language specific replacement if it exists.
You will need tools to find all the message strings in C++.
Maybe you could look for the first argument after error and warning.
That won't work if they are variables, so you might need a macro to
mark them. E.g.,
#define _(A) A
...
char *msg = _("text");
Then we can look for _("msg"), error("msg") and warning("msg"),
returning anything which is a string.
We can provide a _() command for use in m-files too. This would return
the
translated string for things like plot labels and output strings which
are not
warnings or errors. Warnings and error messages will use the lookup
table
in the warning() and error() functions.
Translation strings need to be associated with the toolbox rather than
stored in a central database. I suggest a local file (e.g., i18n.xx)
which
stores the table for each directory. When that directory is added to
the
search path octave can add the strings in i18n.xx for the particular
LANG=xx to its master table. I'm ignoring the problem of removing a
directory from a path.
We need tools listing which strings have changed since they were last
translated.
Paul Kienzle
address@hidden