Visitar URL original
Translations for the theme · Issue #434 · pradyunsg/furo · GitHub
Skip to content

Translations for the theme #434

Open

Description

@pradyunsg

Discussed in #429

This theme currently does not provide translations for any of the text in it, that isn't already a part of the Sphinx translations database. This is an issue for discussing and tracking improvements on this front.

Activity

  1. changed the title [-]Translation fo the theme[/-] [+]Translations for the theme[/+] on May 3, 2022
  2. mpaglia0 commented on Jun 12, 2022

    @mpaglia0

    Hi, I found this very nice theme right now but noticed the same issue.
    I am interested to translate it in Italian.
    thanks
    Maurizio

  3. dbitouze commented on Jul 11, 2022

    @dbitouze
    Contributor

    AFAICS, “Back to top” isn't translated either.

  4. pradyunsg commented on Jul 11, 2022

    @pradyunsg
    OwnerAuthor

    Broadly speaking, most of the stuff in this theme is not translated. It's plumbed into Sphinx's translation engine, but the theme doesn't contain localisations for any of the strings it has that aren't in Sphinx's default translations bundle. Text like "Back to top" is an example of that.

    Honestly, I'm not familiar with how to add translations to this theme such that Sphinx would pick it up (and obviously can't translate to languages that I don't know) -- so help would be welcome for this!

  5. eviau-sat commented on Jul 12, 2022

    @eviau-sat
    Contributor

    Hello - I was onboarded into working on tech doc by working on translation projects using Sphinx, so let me give you a few insights if I may ?

    I hope I understand the question correctly, let me know if that is not the case.

    I would be happy to help translate this theme messages from English to French and to figure out how to set things up generally speaking.

    A few things:

    1. To fetch messages from your theme that needs to be translated, you may follow the general i18n instructions and look for a file named sphinx.po in the locale folder. This is the file with the Sphinx-specific messages. Here is a example of such a file.
    2. There seems to be a Transifex project for translations of Sphinx itself.
    3. Maybe there is a way to take existing translations and integrate them into the Furo theme ?
    4. I am not sure how to add new messages to a Transifex project !

    I am happy to do some research on all of this, let me know what questions you have!

  6. DiddiLeija commented on Jul 13, 2022

    @DiddiLeija
    Contributor

    If you need a Spanish translator, count with me ;)

  7. eviau-sat commented on Jul 13, 2022

    @eviau-sat
    Contributor

    I did some more research !

    The short version is : I believe the more straightforward path would be to add messages to this transifex project for sphinx system messages.

    I believe this because of a message on the Sphinx users list and another similar message on Github.

    I haven't found yet proper instructions on how to translate just one theme while making this translation available... I guess you could commit the sphinx.po file I spoke earlier to the theme ?

    More resources consulted include this Transifex doc on integrating with Sphinx

  8. guifcoelho commented on Jul 28, 2023

    @guifcoelho

    I know that this is not the right solution by far, but if you just need to translate a couple of components you can extend the 'page.html' template (or any other). This was the simplest and quickest solution I managed to implement.

    In the example below, I needed to translate from "On this page" to "Nesta página":

    {% extends "!page.html" %}
    
    {% block right_sidebar %}
      {% if not furo_hide_toc %}
      <div class="toc-sticky toc-scroll">
        <div class="toc-title-container">
          <span class="toc-title">
            {{ _("Nesta página") }}
          </span>
        </div>
        <div class="toc-tree-container">
          <div class="toc-tree">
            {{ toc }}
          </div>
        </div>
      </div>
      {% endif %}
    {% endblock right_sidebar %}`
    
  9. dbitouze commented on Aug 24, 2023

    @dbitouze
    Contributor

    Any progress on the current issue?

  10. pradyunsg commented on Aug 24, 2023

    @pradyunsg
    OwnerAuthor

    help would be welcome for this!

  11. dbitouze commented on Aug 24, 2023

    @dbitouze
    Contributor

    Perhaps you could ask the team who manage the translation of sphinx-rtd-theme on Transifex for help. I have no idea how to go about it but, if you decide to use Transifex, I'll help you translate (as I do for other projects, Sphinx for example).

    But, BTW, while I could find the "Back to top" string in the Furo repo, I couldn't find "on this page" either in the Furo repo or in the Transifex repo for Sphinx.

  12. damian-krawczyk commented on Sep 1, 2023

    @damian-krawczyk

    @pradyunsg you can count me in for Polish 🇵🇱 It would be great to have a native button to switch the language! 🤩

    Here is what I partially did without Transifex

    https://github.com/damian-krawczyk/damiankrawczyk.com/blob/master/docs/locale/pl/LC_MESSAGES/sphinx.po

  13. CAM-Gerlach commented on Sep 6, 2023

    @CAM-Gerlach

    For reference, the similar Pydata Sphinx Theme implemented translation support recently (minus a language switcher, which I plan to hopefully try to contribute in the future), see PR pydata/pydata-sphinx-theme#1192 for details on that.

  14. Kamik423 commented on Oct 25, 2023

    @Kamik423

    🙋 I can do German

  15. alperyazar commented on Apr 26, 2024

    @alperyazar

    I can do Turkish translation. I checked the latest code and saw {% trans %} tags, ref but I don't know whether the theme supports translations at that moment or not. If it is, I would like to contribute.

  16. rffontenelle commented on Oct 28, 2024

    @rffontenelle

    @pradyunsg I'm working on a script to handle localization of Python docs theme at python/python-docs-theme#195. It extracts source strings into template POT file, initializes locale PO files, updates existing PO based on new POT files, and compiles MO files from locales PO file to be used by the theme.

    Are you looking for something like that? Or a more complicated solution ia needed?

  17. pradyunsg commented on Jan 3, 2025

    @pradyunsg
    OwnerAuthor

    It extracts source strings into template POT file, initializes locale PO files, updates existing PO based on new POT files, and compiles MO files from locales PO file to be used by the theme.

    It would be basically the same as that. See pradyunsg/sphinx-theme-builder#24 where I'm trying to make sure that the translation is consistent across the various Sphinx themes (to avoid needing everyone to re-discover all the workflow details again-and-again).

  18. StanFromIreland commented on Apr 4, 2026

    @StanFromIreland

    FTR, the implementation in python-docs-theme was finished in python/python-docs-theme#246 and python/python-docs-theme#263.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededtype: featureA self-contained enhancement or new feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions