|
From: Adam C. <ad...@ch...> - 2002-07-07 02:38:46
|
Hi. Here is a patch with language files for Swedish. I have done some quick tests, and there seems to be some problems with parsing of translated directives. For example, the directive ``.. Innehåll::`` gets treated as a comment and does not result in a table of contents being generated for some strange reason. If I use the English version (``.. Contents::``) but with --language=sv turned on, I get the error: Reporter: ERROR (3) Unknown directive type "contents" at line 10. .. Contents:: So apparantly ``.. Innehåll::`` is recognized as a valid directive at *some* level, but later turned into a comment instead. I haven't tried finding out what's wrong, yet. Admonition directives seem to work fine, and so do bibliographic fields although they get rearranged for some reason: "Författare" is put last, not first in the generated output. --- Adam Chodorowski <ad...@ch...> War is Peace Slavery is Freedom Backspace is Delete. |
|
From: Adam C. <ad...@ch...> - 2002-07-07 02:44:50
Attachments:
sv-translation.patch
|
On Sun, 7 Jul 2002 04:44:05 +0200 Adam Chodorowski <ad...@ch...>
wrote:
> Here is a patch with language files for Swedish.
But ofcourse I forgot to attach the actual patch itself. :) Here it is.
---
Adam Chodorowski <ad...@ch...>
Ludwig Boltzmann, who spent much of his life studying statistical mechanics,
died in 1906, by his own hand. Paul Ehrenfest, carrying on the work, died
similarly in 1933. Now it is our turn to study statistical mechanics.
-- David L. Goodstein "States of Matter"
|
|
From: David G. <go...@us...> - 2002-07-07 14:28:00
|
Adam Chodorowski wrote: > So apparantly ``.. Inneh=E5ll::`` is recognized as a valid directive at *so= me* > level, but later turned into a comment instead. I haven't tried finding o= ut > what's wrong, yet. I haven't had a chance to look at the code, and I won't for a few days (we have visitors), but I do have an idea. Probably, the directive-detecting regular expression is checking for a "simple name" which is alphanumerics plus "-", "_", and ".". "Alphanumerics" is probably limited to "[a-zA-Z0-9]", and should be expanded to cover the locale's idea of what letters should be, including accents. The "=E5" in "Inneh=E5ll" is probably throwing it off. --=20 David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |
|
From: Adam C. <ad...@ch...> - 2002-07-07 14:34:47
|
On Sun, 07 Jul 2002 10:29:12 -0400 David Goodger
<go...@us...> wrote:
> Adam Chodorowski wrote:
> > So apparantly ``.. Innehåll::`` is recognized as a valid directive at
> > *some* level, but later turned into a comment instead. I haven't tried
> > finding out what's wrong, yet.
>
> I haven't had a chance to look at the code, and I won't for a few days (we
> have visitors), but I do have an idea. Probably, the directive-detecting
> regular expression is checking for a "simple name" which is alphanumerics
> plus "-", "_", and ".". "Alphanumerics" is probably limited to
> "[a-zA-Z0-9]", and should be expanded to cover the locale's idea of what
> letters should be, including accents. The "å" in "Innehåll" is probably
> throwing it off.
Yes, this seems very likely. I'll have a closer look as soon as I get back
home. Thanks!
---
Adam Chodorowski <ad...@ch...>
No matter how subtle the wizard, a knife in the shoulder blades will seriously
cramp his style.
-- McCloctnik the Lucid
|
|
From: Adam C. <ad...@ch...> - 2002-07-09 06:11:55
|
On Sun, 07 Jul 2002 10:29:12 -0400 David Goodger
<go...@us...> wrote:
> Adam Chodorowski wrote:
> > So apparantly ``.. Innehåll::`` is recognized as a valid directive at
> > *some* level, but later turned into a comment instead. I haven't tried
> > finding out what's wrong, yet.
>
> I haven't had a chance to look at the code, and I won't for a few days (we
> have visitors), but I do have an idea. Probably, the directive-detecting
> regular expression is checking for a "simple name" which is alphanumerics
> plus "-", "_", and ".". "Alphanumerics" is probably limited to
> "[a-zA-Z0-9]", and should be expanded to cover the locale's idea of what
> letters should be, including accents. The "å" in "Innehåll" is probably
> throwing it off.
I still haven't had time to investigate further, but it struck me that using
the current locale for this simply won't work: it needs to be determined from
the language (that docutils gets with --language). The reason is in server /
build environments where you need to build the docs correctly in a multitud of
different languages, when the locale will probably be "C". So this needs to be
controlled in some language file, I think.
On the subject of languages, how about adding a directive (or bibliographic
field) for specyfying the language used by the document? This way documents
would be self-contained, and you would not need to pass --language to docutils
to get the correct result. Something in the lines of:
.. Language: sv
or:
:Language: sv
---
Adam Chodorowski <ad...@ch...>
Vampireware, n., a project capable of sucking the lifeblood out of anyone
unfortunate enough to be assigned to it which never actually sees the
light of day, but nonetheless refuses to die.
-- Trygve Lode
|
|
From: David G. <go...@us...> - 2002-07-11 02:00:42
|
[Adam] >>> So apparantly ``.. Inneh=C2ll::`` is recognized as a valid directive at >>> *some* level, but later turned into a comment instead. I haven't tried >>> finding out what's wrong, yet. [David] >> I haven't had a chance to look at the code, and I won't for a few days (= we >> have visitors), but I do have an idea. Probably, the directive-detectin= g >> regular expression is checking for a "simple name" which is alphanumeric= s >> plus "-", "_", and ".". "Alphanumerics" is probably limited to >> "[a-zA-Z0-9]", and should be expanded to cover the locale's idea of what >> letters should be, including accents. The "=C2" in "Inneh=C2ll" is probably >> throwing it off. [Adam] > I still haven't had time to investigate further, but it struck me > that using the current locale for this simply won't work: it needs > to be determined from the language (that docutils gets with > --language). The reason is in server / build environments where you > need to build the docs correctly in a multitud of different > languages, when the locale will probably be "C". So this needs to be > controlled in some language file, I think. Or we can just use "\w" in regexes, combined with re.UNICODE. That way, *all* alphanumerics in Unicode, no matter what language, will be matched. It's a bit tricky, since "\w" is defined as "[a-zA-Z0-9_]" (plus lots more, for Unicode), and sometimes we don't want the "[0-9_]". I'll give it a try. ... Done; see the latest CVS. > On the subject of languages, how about adding a directive (or > bibliographic field) for specyfying the language used by the > document? I'm not sure if a bibliographic field is appropriate. The directive idea is already in the To Do list (where it will stay until someone wants it enough). Patches are always welcome! --=20 David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |