I could generate the html-es after modifying several translation, so
with current Spanish translations  on Launchpad no longer FTBFS.

However there is a real problem on how Sphinx handles the translation. The 
problem arise whenever a segment to be translated starts or with a link and the 
translated version adds some text before or after the starting/ending link, 
respectively. For example:
  - if "`Link`_ English text" is translated into "Spanish text `Link`_ more 
text" it breaks Sphinx. 
  - if "English text `Link`_ " is translated into "Spanish text `Link`_ more 
text" it breaks Sphinx.
This should be accepted by the tool, as those  are perfectly normal situations 
(in fact, my modified translation to avoid the problem sounds less natural to 
me than original ones)

The reason for that problem is that the original text and the translated
patch are expected to have  the same number of parts, as the following
debug session shows:

227     
228                 # copy text children
229                 for i, child in enumerate(patch.children):
230                     if isinstance(child, nodes.Text):
231                         child.parent = node
232  ->                     node.children[i] = child
233     
234     
235     class SphinxStandaloneReader(standalone.Reader):
236         """
237         Add our own transforms.

p i
3

p patch.children
[<#text: 'La p\xe1gina '>, <reference: <#text: 'The new accoun ...'>>, <target 
"the new account help page": >, <#text: ' en Launchpad contiene m\xe1s 
informaci\xf3n sobre el proceso y par\xe1me ...'>]

p node.children
[<#text: 'La p\xe1gina '>, <target "the new account help page": >, <#text: 
'\non Launchpad has more information about the process and additio ...'>]

So there are 4 parts in the patch but only 3 in the original text, which
lead to the above problem. For that example I had to modify the
translation in the following way:

Original text:
`The new account help page 
<https://help.launchpad.net/YourAccount/NewAccount>`_ on Launchpad has more 
information about the process and additional settings you can change.

Intended translation:
La página `The new account help page 
<https://help.launchpad.net/YourAccount/NewAccount>`_ en Launchpad contiene más 
información sobre el proceso y parámetros adicionales que puede cambiar.

Modified translation:
`The new account help page 
<https://help.launchpad.net/YourAccount/NewAccount>`_ en Launchpad contiene más 
información sobre el proceso y parámetros adicionales que puede cambiar.

-- 
You received this bug notification because you are a member of Ubuntu
Packaging Guide Team, which is subscribed to Ubuntu Packaging Guide.
https://bugs.launchpad.net/bugs/1068493

Title:
  Spanish translation FTBFS

Status in Sphinx:
  New
Status in Ubuntu Packaging Guide:
  Triaged
Status in “sphinx” package in Ubuntu:
  Triaged

Bug description:
  To reproduce the issue, first do the following:

   - ./debian/scripts/add-languages
   - bzr unknowns | xargs bzr add
   - bzr bd

  You should get the following sphinx crash at the end:
  Exception occurred:
    File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 419, 
in write_doc
      self.docwriter.write(doctree, destination)
    File "/usr/lib/python2.7/dist-packages/docutils/writers/__init__.py", line 
77, in write
      self.translate()
    File "/usr/lib/python2.7/dist-packages/sphinx/writers/html.py", line 38, in 
translate
      self.document.walkabout(visitor)
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 173, in 
walkabout
      if child.walkabout(visitor):
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 173, in 
walkabout
      if child.walkabout(visitor):
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 173, in 
walkabout
      if child.walkabout(visitor):
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 165, in 
walkabout
      visitor.dispatch_visit(self)
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 1604, in 
dispatch_visit
      return method(node)
    File 
"/usr/lib/python2.7/dist-packages/docutils/writers/html4css1/__init__.py", line 
957, in visit_footnote_reference
      href = '#' + node['refid']
    File "/usr/lib/python2.7/dist-packages/docutils/nodes.py", line 534, in 
__getitem__
      return self.attributes[key]
  KeyError: 'refid'

  I was able to track down a number of issues in the Spanish
  translation. A diff is available here:
  http://paste.ubuntu.com/1288743/

  Unfortunately I didn't manage to track all of them down.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sphinx/+bug/1068493/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-packaging-guide-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-packaging-guide-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to