Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added localization language support #403 #405

Open
wants to merge 44 commits into
base: master
from

Conversation

Projects
None yet
@macagua
Copy link

macagua commented Apr 1, 2017

  • Added i18n support using Babel
  • Added Spanish translation
  • Updated .gitignore file
@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented Apr 1, 2017

Awesome IMO we should hold off on 0.2.5 until this gets merged.

@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented Apr 1, 2017

Once this gets merged I can talk to some of our translators and get the following translations:

  • De
  • Fr
  • It
  • Ja
  • Pt
  • Ru
  • Zh (Simplified)
  • Zh (Traditional)
@mitya57
Copy link
Contributor

mitya57 left a comment

  • Please do not include the binary .mo files in the repository. Storing the binary files in Git is a bad idea, and this file is (re-)created by Sphinx during build anyway.
  • The .gitignore changes seem unrelated.

Once this is merged, I will be happy to provide a Russian translation. I have it ready already :)

Leonardo Caballero
@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 2, 2017

@mitya57 you are right about .gitignore file I revert this commit :-)

@mitya57

This comment has been minimized.

Copy link
Contributor

mitya57 commented Apr 2, 2017

It was better to rebase without that commit, rather than reverting.

But I am not the maintainer so I have no voice here anyway :)

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 3, 2017

@mitya57 please check out these improvements!

@mitya57
Copy link
Contributor

mitya57 left a comment

Still adding the binary .mo file. Also, left an inline comment for setup.py changes.

setup.py Outdated
'Sphinx>=1.4.1',
],
cmdclass = {
'compile_catalog': babel.compile_catalog,

This comment has been minimized.

@mitya57

mitya57 Apr 3, 2017

Contributor

If babel was not imported, this would be an undefined variable access. You can see this failure on Travis.

In my opinion setup.py modifications are not needed at all. This project is using setuptools, and babel is installing an entry point for setuptools, so these commands are available automatically.

This comment has been minimized.

@macagua

macagua Apr 3, 2017

Author

@mitya57 it is the problem :(

then remove the Babel Distutils/setuptools integration? I had to install Babel via pip install so I could extract the strings to translate and compile the mo file.

This comment has been minimized.

@mitya57

mitya57 Apr 3, 2017

Contributor

When babel is installed, its setup.py commands should work automatically, without your changes to setup.py.

This comment has been minimized.

@macagua

macagua Apr 3, 2017

Author

@mitya57 An good alternative will be create a requeriments-devs.txt file with the Jinja2 and Babel dependencies or create a TRANSLATE file with this instructions.

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 3, 2017

@mitya57 Removed sphinx.mo file 8f21fd0

Removed Sphinx and Babel command class from setup.py file and added a…
… TRANSLATE file for more details about translate the package
@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 3, 2017

@mitya57 done 👍

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 7, 2017

@mitya57 any update about this?

@mitya57

This comment has been minimized.

Copy link
Contributor

mitya57 commented Apr 7, 2017

@macagua As I said, I am not the maintainer here, so someone else should merge this.

It looks good to me, though I would squash all commits into a single one to remove the useless changes (this can be done when merging though).

@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented Apr 7, 2017

LGTM

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Apr 8, 2017

@mitya57 thanks you!!!
Maybe @agjohnson or @ericholscher can check and merge this improvement?

@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented Apr 8, 2017

@agjohnson
Copy link
Collaborator

agjohnson left a comment

I noted some documentation changes, but otherwise I think this makes sense.

Our current workflow on RTD is to use Transifex. If there is anything here that competes with that, I'd rather update our process here to match.

README.rst Outdated
============

You can help to translate the Read the Docs Sphinx Theme,
please check out the ``TRANSLATE.rst`` file for more details.

This comment has been minimized.

@agjohnson

agjohnson Apr 10, 2017

Collaborator

I'm -1 on littering the repo with these files, this should be in our documentation instead.

This comment has been minimized.

@macagua

macagua Apr 14, 2017

Author

@agjohnson inside a docs directory with a Sphinx documentation format?

This comment has been minimized.

@Blendify

Blendify Jun 18, 2017

Contributor

I think inside the demo docs. Are general idea is to make them include more information about the theme.

This comment has been minimized.

@macagua
Languages availables:

- Spanish contributed by Leonardo J. Caballero G.
- Your Language by YOUR NAME.

This comment has been minimized.

@agjohnson

agjohnson Apr 10, 2017

Collaborator

This file should be moved into our docs. Also, I'm very happy to apply attribution, but putting author and translation status information in the docs is guaranteed to go stale. I'd rather avoid this and keep authors in another location.

This comment has been minimized.

@Blendify

Blendify Jun 18, 2017

Contributor

I agree.

This comment has been minimized.

@macagua

macagua Sep 29, 2017

Author

@agjohnson @Blendify when you said "This file should be moved into our docs" are you refernce into the docs readthedocs.org? Or what kind of location are you preference? or what other location are you preference?

Installation
============

For translate the Read the Docs Sphinx Theme you need install the following packages:

This comment has been minimized.

@agjohnson

agjohnson Apr 10, 2017

Collaborator
  • For translate -> For translating
  • you need install -> you will need to install

This comment has been minimized.

@macagua

macagua Apr 14, 2017

Author

@agjohnson done with commit 15d2198


.. code:: bash
$ pip install babel Jinja2

This comment has been minimized.

@agjohnson

agjohnson Apr 10, 2017

Collaborator

Jinja2 is a sphinx requirement and should already be present as part of development set up for this package.

This comment has been minimized.

@macagua

macagua Apr 14, 2017

Author

@agjohnson I agree with you, but it is not clear when downloading this package so at least I indicate that dependencies minimally require to generate the gettext files with the Babel library from this package.

Remember that when you install this package using the command python setup.py install does not install any dependencies, ie. does not install Sphinx package.

This comment has been minimized.

@macagua

macagua Sep 29, 2017

Author

@agjohnson Any news on this comment?

--------------

It is available the option to init catalog.
More options please, check out http://babel.pocoo.org/en/latest/setup.html#update-catalog

This comment has been minimized.

@agjohnson

agjohnson Apr 10, 2017

Collaborator

This disutils section doesn't seem to clarify anything. It can either be dropped completely, or updated to be a list of explicit steps an author will need to take to create a translation.

macagua and others added some commits Apr 14, 2017

@rtfd rtfd deleted a comment Jun 18, 2017

@rtfd rtfd deleted a comment Jun 18, 2017

@rtfd rtfd deleted a comment Jun 18, 2017

@@ -38,6 +38,7 @@
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinxcontrib.httpdomain',
'sphinx_rtd_theme',

This comment has been minimized.

@Blendify

Blendify May 1, 2018

Contributor

If this is needed for users to make Sphinx work you need to add it to the installing docs.

This comment has been minimized.

@macagua

macagua May 2, 2018

Author

You are right, just that first I want to show the way to resolve this improvement, If it's accepted, then I believe that these changes have to be documented.

@macagua

This comment has been minimized.

Copy link
Author

macagua commented May 2, 2018

Via Takayuki Shimizukawa on Sphinx-Dev list reponse about how enabled my locales from a Sphinx theme said:

I think `add_message_catalog` API will serve your purpose.
However the API is provided since sphinx-1.8 (in development).
http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog

With using sphinx-1.8(repository master), please write the setup function of sphinx_rtd_theme as bellow::

    def setup(app):
        app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))

        rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')

        # for sphinx-1.8 or later
        app.add_message_catalog('sphinx', rtd_locale_path)

and `conf.py` of documentation must have::

    extensions = [
        'sphinx_rtd_theme',
    ]
    language = 'es'
    html_theme = 'sphinx_rtd_theme'

@Blendify @agjohnson Thene can you trying again to test? just need follow the above instructions and you need to install the the sphinx-1.8 (repository master), with this command::

pip install -U git+https://github.com/sphinx-doc/sphinx.git@master#egg=sphinx

Then you will can see Spanish translation enable into HTML files generation.

@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented May 2, 2018

@borisalmonacid

This comment has been minimized.

Copy link

borisalmonacid commented May 18, 2018

I need that in my life :)

@agjohnson agjohnson modified the milestones: v0.4.0, 0.5 Jun 7, 2018

@agjohnson

This comment has been minimized.

Copy link
Collaborator

agjohnson commented Jun 7, 2018

Pushing this up to 0.6 at least, as it will depend on Sphinx==1.8 anyways.

@agjohnson agjohnson modified the milestones: 0.5, 0.6 Jun 7, 2018

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Jun 12, 2018

@agjohnson Thanks you! I will waiting any feedback or the release at PyPi!

"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr ""
"Su búsqueda no coincide con ningún documentos. Por favor, asegúrese de "

This comment has been minimized.

@c0x6a

c0x6a Jul 5, 2018

documento must be in singular.

"are spelled correctly and that you've selected enough categories."
msgstr ""
"Su búsqueda no coincide con ningún documentos. Por favor, asegúrese de "
"que todas las palabras estén correctamente escritas y que usted allá "

This comment has been minimized.

@c0x6a

c0x6a Jul 5, 2018

...y que usted haya , the word allá is an indicative of a place.


#: sphinx_rtd_theme/breadcrumbs.html:62 sphinx_rtd_theme/breadcrumbs.html:64
msgid "View page source"
msgstr "Ver página de código fuente"

This comment has been minimized.

@c0x6a

c0x6a Jul 5, 2018

I think a more appropriate translation can be: Ver código fuente de la página

@socketpair

This comment has been minimized.

Copy link

socketpair commented Nov 3, 2018

So, what is the status of everything that ? Is it frozen ?

@Blendify

This comment has been minimized.

Copy link
Contributor

Blendify commented Nov 4, 2018

Now that sphinx 1.8 is out we can take another look.

Blendify added some commits Nov 5, 2018

Revert change
Reverts fffca44
@daonkim

This comment has been minimized.

Copy link

daonkim commented Nov 19, 2018

Wow

@macagua

This comment has been minimized.

Copy link
Author

macagua commented Jan 22, 2019

@Blendify How can help to merge this improvements?

@derdennis

This comment has been minimized.

Copy link

derdennis commented Feb 23, 2019

Hello all,

I authored #587 almost a year ago and wanted to ask, if there is anything I can do to help with getting the proper internationalisation of this theme along? My impression is, that almost everything depends on this #405?

Blendify added some commits Mar 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.