Problems to build translations from .mo

56 views
Skip to first unread message

bg

unread,
Nov 13, 2011, 11:51:27 AM11/13/11
to sphinx-dev
Hi there.

We're quite new to restructured text and one or our programmers and I
have hit a wall with building the translation of a user manual. Google-
Fu has failed, so after burning quite a few hours on it, I'm here to
ask for help.

My quite fresh installation:
* Windows 7 Starter
* Python 2.7
* Sphinx 1.1.2

An HTML build of the original German user manual is successful. Then I
tried to build the (translated) English manual and fail.

My configuration:
reST Soures and conf.py in folder c:\material\
.mo files in c:\material\locale\en\LC_MESSAGES\

conf.py settings:
# The language for content autogenerated by Sphinx. Refer to
documentation
# for a list of supported languages.
# language = "de"
language = "en"
locale_dirs = ['locale/']

Command line:
Sphinx-build –b html –D language=en c:\material\ c:\material\output

I tried various other folder organizations too but always get a
"locale no available", and I'm out of ideas. Help would be much
appreciated.

Thanks, Birgit

gilberto dos santos alves

unread,
Nov 13, 2011, 2:48:25 PM11/13/11
to sphin...@googlegroups.com
hi! i have used this kind of translation in my debian lenny (linux) in
english and in portuguese brazil (pt-br) sphinx 1.0.7. For now windows
7 ultimate i will make tests and send results. I suspect that you must
have explicit full path of your translation files, see sphinx install
procedures e if is true that locales files are there. expected time
to test 1 day.

2011/11/13, bg <bcgro...@googlemail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-dev" group.
> To post to this group, send email to sphin...@googlegroups.com.
> To unsubscribe from this group, send email to
> sphinx-dev+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sphinx-dev?hl=en.
>
>


--
gilberto dos santos alves

(11) 8646-5049
são paulo - SP - Brasil

bg

unread,
Nov 13, 2011, 6:10:36 PM11/13/11
to sphinx-dev
Thanks for your response.

I tried with the full path and it had no effect. It would be
interesting to know if it has an effect on your system.

In the middle of my experiments tonight (I installed rst2pdf and
played around with it), and despite still getting the "locale not
available" message, Sphinx compiled _most_ of my contents to English
HTML output. Not all, and it looked a bit random what was missing. I
tried two runs, both gave English outputs.

Then I changed the locale settings briefly to German to test
something, then back to English - and once again, _no_ English output :
(

Sorry for not being able to offer a better description. I have saved
the first successful run so that I can prove to myself that it worked
once before I end feeling like a crazy :)

Help still very appreciated.

Birgit

On Nov 13, 7:48 pm, gilberto dos santos alves <gsa...@gmail.com>
wrote:
> hi! i have used this kind of translation in my debian lenny (linux) in
> english and in portuguese brazil (pt-br) sphinx 1.0.7. For now windows
> 7 ultimate i will make tests and send results. I suspect that you must
> have explicit full path of your translation files, see sphinx install
> procedures  e if is true that locales files are there. expected time
> to test 1 day.
>
> 2011/11/13, bg <bcgrossm...@googlemail.com>:
>

gilberto dos santos alves

unread,
Nov 13, 2011, 6:41:11 PM11/13/11
to sphin...@googlegroups.com
I have made small test: file 1-index.rst, 2-conf.py (delimited by an
separator *end*of*file) and anexed file is html (saved in format of 1
file (mht) to show results. see that you have parts from text in
english, portuguese and deutsche. Please see what is procedures that
you have used for install sphinx? be sure that what you have installed
is in the : Pasta de C:\Python27\Lib\site-packages like this..

13/11/2011 19:49 <DIR> .
13/11/2011 19:49 <DIR> ..
13/11/2011 19:49 <DIR> docutils
13/11/2011 19:49 <DIR> docutils-0.8.1-py2.7.egg-info
13/11/2011 19:06 207 easy-install.pth
20/09/2006 15:05 126 easy_install.py
13/11/2011 18:41 312 easy_install.pyc
13/11/2011 18:41 312 easy_install.pyo
13/11/2011 19:49 <DIR> jinja2
13/11/2011 19:49 <DIR> Jinja2-2.6-py2.7.egg-info
13/11/2011 19:06 <DIR> pip-1.0.2-py2.7.egg
19/10/2009 11:35 85.435 pkg_resources.py
13/11/2011 18:41 90.779 pkg_resources.pyc
13/11/2011 18:41 90.779 pkg_resources.pyo
13/11/2011 19:49 <DIR> pygments
13/11/2011 19:49 <DIR> Pygments-1.4-py2.7.egg-info
03/11/2011 00:56 <DIR> pyPdf
03/11/2011 00:56 1.330 pyPdf-1.13-py2.7.egg-info
08/03/2011 10:39 121 README.txt
13/11/2011 19:48 2.687 roman.py
13/11/2011 19:49 3.490 roman.pyc
13/11/2011 19:06 <DIR> setuptools
13/11/2011 18:41 <DIR> setuptools-0.6c11-py2.7.egg-info
20/09/2006 15:05 2.362 site.py
13/11/2011 18:41 1.719 site.pyc
13/11/2011 18:41 1.719 site.pyo
13/11/2011 19:49 <DIR> sphinx
13/11/2011 19:49 <DIR> Sphinx-1.1.2-py2.7.egg-info
....
I hope this small test may help.

*end*of*file

1- this is the index.rst

.. demonstração em português sphinx windows 7 documentation master
file, created by
sphinx-quickstart on Sun Nov 13 20:13:06 2011.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Benvindo demonstração em português do Brasil com sphinx !
=========================================================

Todos os elementos deste texto foram produzidos para apresentação em
qualquer lingua
pois utilizamos utf-8. Com este código podemos produzir muitos simbolos.

Outros caracteres não tem restrição. Nossa língua também esta no
código latin-1. Quando
são produzidos em iso-8859-1. Outro detalhe é se cada linha termina
com caracter CR ou LF ou
ambos CRLF (que é o normal em Windows) Será possivel utilizar também
codepage windows cp125x.

Veja que alguns termos continuam sem tradução.

Conteúdo:

.. toctree::
:maxdepth: 2

Índices e Tabelas
=================

* :ref:`genindex`
* :ref:`search`
*end*of*file
2- this is the conf.py (attention to line #57 language ex: pt-BR, fr, de etc..)
# -*- coding: utf-8 -*-
#
# demonstração em português sphinx windows 7 documentation build
configuration file, created by
# sphinx-quickstart on Sun Nov 13 20:13:06 2011.
#
# This file is execfile() the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['axtemplates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'demonstração em português sphinx windows 7'
copyright = u'2011, gilberto dos santos alves'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.11'
# The full version, including alpha/beta/rc tags.
release = '13'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

language = 'de'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['axbuild']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []


# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = u'Títulos em Português do Brasil'

# A shorter title for the navigation bar. Default is the same as html_title.
html_short_title = "Mostra Brasil python"

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['axstatic']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'demonstraoemportugussphinxwindows7doc'


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'demonstraoemportugussphinxwindows7.tex', u'demonstração
em português sphinx windows 7 Documentation',
u'gilberto dos santos alves', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True


# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'demonstraoemportugussphinxwindows7', u'demonstração em
português sphinx windows 7 Documentation',
[u'gilberto dos santos alves'], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False


# -- Options for Texinfo output ------------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'demonstraoemportugussphinxwindows7', u'demonstração em
português sphinx windows 7 Documentation',
u'gilberto dos santos alves', 'demonstraoemportugussphinxwindows7',
'One line description of project.',
'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

=============== end of response...


2011/11/13, bg <bcgro...@googlemail.com>:

Benvindo demonstração em português do Brasil com sphinx ! — Títulos em Português do Brasil.mht

bg

unread,
Nov 14, 2011, 2:16:11 PM11/14/11
to sphinx-dev
Thank you for your quick answer.

I tried to retrieve the attached file but I failed? Both saving as
well as forwarding didn't yield the full file, do you have a tip for
me?

Another question. You pasted:

# The language for content autogenerated by Sphinx. Refer to
documentation
# for a list of supported languages.
language = 'de'

When you enter several languages, do you enter all of them, like
language = 'de'
language = 'en'
language = 'fr'

?

Bye till soon, Birgit

On Nov 13, 11:41 pm, gilberto dos santos alves <gsa...@gmail.com>
wrote:

gilberto dos santos alves

unread,
Nov 14, 2011, 8:23:09 PM11/14/11
to sphin...@googlegroups.com
hi!
.mht files are like zip files (html, css, image) all in one file open with any browser iexplore, mozilla firefox, opera, etc (1rst download file and after open it with your browser.
when you created your document in .rst and you want generate your html ou pdf sphinx allow you select what is butons, tags, labels used for navigations is created (see .mht attached) in my sample my text is in portuguese and butons are in german.
are you see syntax for create you documents ex:  make html

this command creates html is placed in axbuild/html/index.html
see your make?
C:\memo>make  
Please use `make <target>` where <target> is one of
  html       to make standalone HTML files
  dirhtml    to make HTML files named index.html in directories
  singlehtml to make a single large HTML file
  pickle     to make pickle files
  json       to make JSON files
  htmlhelp   to make HTML files and a HTML help project
  qthelp     to make HTML files and a qthelp project
  devhelp    to make HTML files and a Devhelp project
  epub       to make an epub
  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  text       to make text files
  man        to make manual pages
  texinfo    to make Texinfo files
  gettext    to make PO message catalogs
  changes    to make an overview over all changed/added/deprecated items
  linkcheck  to check all external links for integrity
  doctest    to run all doctests embedded in the documentation if enabled

attached folder memo.zip contais all my samples



2011/11/14 bg <bcgro...@googlemail.com>
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.

axbuild.zip

bg

unread,
Nov 16, 2011, 4:27:15 PM11/16/11
to sphinx-dev
Hi there.

Thanks for the attached zip, I could download this one. (The mht file
came across as binary and google groups was completely unwilling to
give me the full code :/).

The file is axbuild.zip, though, and only includes the HTML, I think?
If you've got memo.zip with all files around, I'd still take it :)

Guess I'm still a bit confused about the settings but I'm going to try
the makefile on the weekend - sphinx-quickstart on my Windows created
a make.bat which then claimed that the source could not be found :/ My
next tests will be setting it up on WinXP and a Linux VM, but that's
got to wait a few days.

Birgit, on the road right now

On Nov 15, 2:23 am, gilberto dos santos alves <gsa...@gmail.com>
wrote:
> 2011/11/14 bg <bcgrossm...@googlemail.com>
>  axbuild.zip
> 100KViewDownload

gilberto dos santos alves

unread,
Nov 17, 2011, 8:16:50 AM11/17/11
to sphin...@googlegroups.com, bcgro...@googlemail.com
hi! i have created with option that all files are (including source
rst) remain in html directory too. Anyway i zipped directory memo . i
used a password because google avoid we send .bat files (that i
renamed make.bat to make.bat.txt). the password i put in this file is:
memo
sphinx will work in windows xp, vista, 7, etc. take care when you
choose python version because in pypi (ease install) until last week
people do not have sphinx package well formed for python 2.7.2 and for
the last, for install sphinx you must have internet conection or
previously download then.

password for zip file (from_memo.zip = memo)

7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=pt_BR.utf8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: /home/usradm/from_memo.zip

Testing memo/Makefile
Testing memo/axbuild/doctrees/environment.pickle
Testing memo/axbuild/doctrees/index.doctree
Testing memo/axbuild/html/.buildinfo
Testing memo/axbuild/html/_sources/index.txt
Testing memo/axbuild/html/_static/ajax-loader.gif
Testing memo/axbuild/html/_static/basic.css
Testing memo/axbuild/html/_static/comment-bright.png
Testing memo/axbuild/html/_static/comment-close.png
Testing memo/axbuild/html/_static/comment.png
Testing memo/axbuild/html/_static/default.css
Testing memo/axbuild/html/_static/doctools.js
Testing memo/axbuild/html/_static/down-pressed.png
Testing memo/axbuild/html/_static/down.png
Testing memo/axbuild/html/_static/file.png
Testing memo/axbuild/html/_static/jquery.js
Testing memo/axbuild/html/_static/minus.png
Testing memo/axbuild/html/_static/plus.png
Testing memo/axbuild/html/_static/pygments.css
Testing memo/axbuild/html/_static/searchtools.js
Testing memo/axbuild/html/_static/sidebar.js
Testing memo/axbuild/html/_static/translations.js
Testing memo/axbuild/html/_static/underscore.js
Testing memo/axbuild/html/_static/up-pressed.png
Testing memo/axbuild/html/_static/up.png
Testing memo/axbuild/html/_static/websupport.js
Testing memo/axbuild/html/genindex.html
Testing memo/axbuild/html/index.html
Testing memo/axbuild/html/objects.inv
Testing memo/axbuild/html/search.html
Testing memo/axbuild/html/searchindex.js
Testing memo/axstatic/nihilfile1.txt
Testing memo/axtemplates/nihilfile2.txt
Testing memo/conf.py
Testing memo/index.rst
Testing memo/make.bat.txt <<<<<<===============

Everything is Ok

Files: 36
Size: 207425
Compressed: 83359

Everything is Ok

Files: 36
Size: 207425
Compressed: 83351

bye!


2011/11/16, bg <bcgro...@googlemail.com>:

from_memo.zip
Reply all
Reply to author
Forward
0 new messages