From: Jean-Christophe Helary <fusion@mx6.tiki.ne.jp>
To: Emacs Mailing List <help-gnu-emacs@gnu.org>
Subject: A system for localizing documentation strings
Date: Thu, 26 Jul 2007 10:05:36 +0900 [thread overview]
Message-ID: <795F38F4-7253-47DC-97DD-53BED4F0AB97@mx6.tiki.ne.jp> (raw)
A function is written like this (per Robert Chassell's book, I'm
currently only at chapter 3, sorry if all sounds a little too obvious):
(defun function-name (arguments...)
"optional-documentation..."
(interactive argument-passing-info) ; optional
body...)
To offer a practical possibility for interactive localization we'd
need a function that dynamically generates output instead of the
"optional-documentation..." string. This function would take a number
of paired arguments:
(docfun
source-language-1 source-language-1-documentation-string
source-language-2 source-language-2-documentation-string
etc ...)
for ex:
(docfun
EN "optional-documentation in EN..."
FR "documentation optionnelle en FR...")
docfun would provide the data (language+string) to the display
devices (help functions etc) that would need to be able to get the
proper string based on the environment locale (or whatever locale
data is available). In case the locale matching string is not
available (not translated), a mechanism to display a prefered
language, then the default language should be implemented.
In the end, the template for a defun would be:
Template 1:
(defun function-name (arguments...)
(docfun
EN "optional-documentation in EN..."
FR "documentation optionnelle en FR...")
(interactive argument-passing-info) ; optional
body...)
To simplify the writing, in the case a lot of functions and
documentation needs to be written (which is always a good thing) we
could have a doclang function that takes one argument, the language
in which the documentation has been written so that a typical .el
file could look like:
Template 2:
(doclang JA) ; optional so keep backward compatibility with the
current lack of framework
(defun function-name1 (arguments...)
"このファンクションのドキュメンテーションは日本語だ..."
(interactive argument-passing-info) ; optional
body...)
(defun function-name2 (arguments...)
"このファンクションのドキュメンテーションも日本語だ..."
(interactive argument-passing-info) ; optional
body...)
Now, to offer a real framework for translating, since we _don't want
to use intermediate formats (like PO etc), although those could be
available for gettext fans, we'd need another function that takes a
number of arguments and that could look like:
(transfun function-name
source-language
target-language
reference-function-name ; should be a list
reference-file ; should be a list)
The function-name declares which function has to be translated
The source-language declares from which language string the source
should be displayed
The target-language declares to which language the translator is working
the reference-function-name declares which functions should be taken
as reference for the current translation.
the reference-file declares which files should be taken as reference
(ideally, PO compendia, TMX files, CSV files etc)
transfun would be a whole different business since it would actually
provide a real dynamic fuzzy matching engine between the source-
language strings and the source reference strings. _NOT_ something
like the "fuzzy" thing gettext provides.
In the case of Template 1 (a function that has already been
translated to a number of languages), transfun would just add a line
to the documentation function.
In the case of Template 2 (a function that exists in only one
language), transfun would also transform Template 2 into Template 1
to add the documentation at the proper location. If the doclang
function is not documented, transfun asks what argument should
doclang have and proceeds.
Now, it would of course be possible to have translation tools support
the defun template so that they output the target strings to the
correct position.
Of course, I am only talking about functions here (remember: chapter
3 of Chassell's book) but I am gessing that most of this "framework"
could be extended to support _all_ the translatable strings emacs
displays.
As for the quality of the translation (and it seems it is mostly
people who have never done translation work before who complain the
most) I suggest you leave that to the localization groups that are
used to the processes.
What we need is provide 1) a way for coders to identify the necessary
strings for the translation 2) a way for translators to add
translated strings "the emacs way" 3) a modification of the display
procedures to take the new strings into account.
Jean-Christophe Helary
next reply other threads:[~2007-07-26 1:05 UTC|newest]
Thread overview: 120+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 1:05 Jean-Christophe Helary [this message]
2007-07-26 3:18 ` A system for localizing documentation strings Eli Zaretskii
2007-07-26 3:29 ` Fwd: " Jean-Christophe Helary
2007-07-26 11:54 ` Kenichi Handa
2007-07-26 13:28 ` Jean-Christophe Helary
2007-07-27 0:30 ` Kenichi Handa
2007-07-27 1:18 ` Jean-Christophe Helary
2007-07-26 12:13 ` Fwd: " Eli Zaretskii
2007-07-26 13:51 ` Jean-Christophe Helary
2007-07-26 14:50 ` Jason Rumney
2007-07-26 15:27 ` Jean-Christophe Helary
2007-07-26 15:41 ` Jason Rumney
2007-07-26 15:49 ` Jean-Christophe Helary
2007-07-26 16:15 ` Jason Rumney
2007-07-26 16:25 ` Jean-Christophe Helary
2007-07-26 16:28 ` Jean-Christophe Helary
2007-07-26 16:44 ` Jason Rumney
2007-07-27 5:04 ` Richard Stallman
2007-07-27 7:22 ` Jean-Christophe Helary
2007-07-27 7:49 ` David Kastrup
2007-07-27 7:52 ` David Kastrup
2007-07-27 11:16 ` Eli Zaretskii
2007-07-27 12:07 ` Kenichi Handa
2007-07-27 12:26 ` David Kastrup
2007-07-27 12:53 ` Kenichi Handa
2007-07-27 14:43 ` Jean-Christophe Helary
2007-07-28 14:11 ` Richard Stallman
2007-07-27 16:03 ` Henrik Enberg
2007-07-27 14:09 ` Werner LEMBERG
2007-07-27 18:47 ` Eli Zaretskii
2007-07-27 11:37 ` David Kastrup
2007-07-28 14:11 ` Richard Stallman
2007-07-26 15:10 ` Eli Zaretskii
2007-07-26 15:42 ` Jean-Christophe Helary
2007-07-26 16:03 ` Jason Rumney
2007-07-26 16:23 ` Jean-Christophe Helary
2007-07-27 5:04 ` Richard Stallman
2007-07-26 19:34 ` Eli Zaretskii
2007-07-26 19:54 ` David Kastrup
2007-07-26 15:36 ` Fwd: " Andreas Schwab
2007-07-26 19:09 ` Eli Zaretskii
[not found] ` <871weuk228.fsf@uwakimon.sk.tsukuba.ac.jp>
2007-07-27 9:53 ` Andreas Schwab
2007-07-27 11:14 ` Eli Zaretskii
2007-07-27 11:43 ` Andreas Schwab
2007-07-27 11:59 ` Eli Zaretskii
2007-07-27 12:17 ` Andreas Schwab
2007-07-27 18:36 ` Eli Zaretskii
2007-07-27 14:56 ` Jan Djärv
2007-07-27 15:18 ` Jason Rumney
2007-07-27 15:28 ` Jan Djärv
2007-07-27 15:59 ` Jean-Christophe Helary
2007-07-27 16:09 ` Fwd: " Jason Rumney
2007-07-27 17:53 ` Jan Djärv
2007-07-28 3:13 ` Jean-Christophe Helary
2007-07-27 16:14 ` Fwd: " David Kastrup
2007-07-27 16:55 ` Jason Rumney
2007-07-27 12:27 ` Kenichi Handa
2007-07-27 15:00 ` Jan Djärv
2007-07-27 11:12 ` Eli Zaretskii
2007-07-27 11:45 ` Andreas Schwab
2007-07-27 12:18 ` Stephen J. Turnbull
2007-07-27 12:08 ` Eli Zaretskii
2007-07-27 16:24 ` Richard Stallman
2007-07-27 2:16 ` Summary (Re: A system for localizing documentation strings) Jean-Christophe Helary
2007-07-27 5:44 ` Stefan Monnier
2007-07-27 7:24 ` David Reitter
2007-07-27 7:45 ` Stefan Monnier
2007-07-27 8:03 ` Jan Djärv
2007-07-27 8:18 ` Jason Rumney
2007-07-27 9:04 ` Jan Djärv
2007-07-27 9:22 ` David Kastrup
2007-07-27 9:39 ` Jan Djärv
2007-07-27 9:46 ` David Kastrup
2007-07-27 11:49 ` Eli Zaretskii
2007-07-27 15:11 ` Jan Djärv
2007-07-27 11:20 ` Eli Zaretskii
2007-07-27 14:52 ` Jan Djärv
2007-07-27 12:13 ` Jean-Christophe Helary
2007-07-27 15:16 ` Jan Djärv
2007-07-27 15:55 ` Jean-Christophe Helary
2007-07-27 8:21 ` David Kastrup
2007-07-27 9:08 ` Jan Djärv
2007-07-27 9:33 ` David Kastrup
2007-07-27 9:38 ` Jan Djärv
2007-07-27 11:05 ` Jean-Christophe Helary
2007-07-27 11:19 ` Lennart Borgman (gmail)
2007-07-27 11:23 ` Eli Zaretskii
2007-07-28 14:11 ` Richard Stallman
2007-07-27 11:08 ` Andreas Schwab
2007-07-27 11:15 ` Jean-Christophe Helary
2007-07-27 11:54 ` Eli Zaretskii
2007-07-27 11:59 ` Jason Rumney
2007-07-27 13:13 ` Jean-Christophe Helary
2007-07-27 13:42 ` David Kastrup
2007-07-27 14:12 ` Jean-Christophe Helary
2007-07-28 14:11 ` Richard Stallman
2007-07-28 22:49 ` David Kastrup
2007-07-27 15:07 ` Jan Djärv
2007-07-27 15:41 ` Jean-Christophe Helary
2007-07-27 16:11 ` Andreas Schwab
2007-07-28 2:57 ` Jean-Christophe Helary
2007-07-28 14:11 ` Richard Stallman
2007-07-27 16:24 ` Richard Stallman
2007-07-28 2:53 ` Jean-Christophe Helary
2007-07-29 2:22 ` Richard Stallman
2007-07-29 4:46 ` Jean-Christophe Helary
2007-07-29 16:55 ` M Jared Finder
2007-07-30 0:57 ` Jean-Christophe Helary
2007-07-30 16:43 ` Richard Stallman
2007-07-30 17:04 ` Jean-Christophe Helary
2007-07-31 3:38 ` Richard Stallman
2007-07-31 4:16 ` Jean-Christophe Helary
2007-07-31 6:05 ` Jan Djärv
2007-08-02 0:32 ` Jean-Christophe Helary
2007-08-02 23:43 ` Richard Stallman
2007-08-01 18:11 ` Davis Herring
2007-08-02 0:25 ` Jean-Christophe Helary
2007-08-02 5:47 ` Miles Bader
2007-07-27 5:04 ` Fwd: A system for localizing documentation strings Richard Stallman
2007-07-27 8:29 ` Jean-Christophe Helary
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=795F38F4-7253-47DC-97DD-53BED4F0AB97@mx6.tiki.ne.jp \
--to=fusion@mx6.tiki.ne.jp \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.