Skip to content

Feature request: Add ability to change default language #586

Closed

Description

@amyrlam

Is this a bug report?

No

Have you read the Contributing Guidelines on issues?

Yes

Steps to Reproduce

  1. Clone https://github.com/reasonml/reasonml.github.io.
  2. Change website/languages.js to just have Deutsch as the only enabled: true.
  3. cd website and yarn start.
  4. http://localhost:3000/ still appears in English.
  5. Navigate to http://localhost:3000/de and page is broken, see image below:

image

Consider adding ability to change the default language from English to something else in Docusaurus.

Activity

  1. added
    feature
    difficulty: intermediate
    on Apr 19, 2018
  2. hellokaton commented on Apr 30, 2018

    @hellokaton

    I also urgently need this feature.

  3. endiliey commented on May 22, 2018

    @endiliey
    Contributor

    @JoelMarcey @amyrlam @yangshun @biezhi. What is the right behavior for this feature?

    https://docusaurus.io/docs/en/translation.html
    The current state is that

    1. Pages with text that you want translated should be placed in website/pages/en folder.
    2. Docs is just placed in docs folder as md

    Let's say I want my default language to be 'it' (Italia). Can I assume:

    1. I write docs markdown in docs folder in italian
    2. I write my custom pages in website/pages/it instead of website/pages/en in Italian

    Or ...

    1. I write docs markdown in docs folder in italian
    2. I write my custom pages in website/pages/en in Italian

    Or ..

    1. I write docs markdown in docs folder in English
    2. I write my custom pages in website/pages/en in English`
    3. use crowdin to write the Italian version

    But http://localhost:3000/ will appears in Italian

  4. JoelMarcey commented on May 22, 2018

    @JoelMarcey
    Contributor

    @endiliey Hi!

    Personally, I think your 1st option (docs in Italian, website/pages/it) is the most user-friendly and easily understood option, but may be hardest to implement. Your third option may be the easiest to implement.

    From my perspective, I think those are the options available to us and I believe, in order or my preference, it would be:

    • 1
    • 3
    • 2
  5. endiliey commented on May 22, 2018

    @endiliey
    Contributor

    @JoelMarcey

    Yeah, I actually ordered it in the order of how hard it is to implement but makes more sense to the user. It's quite clear that there will be quite a refactoring here, but i guess it's worth a try.

    I'm new to contributing but I plan to contribute to Docusaurus on a longer term.

  6. JoelMarcey commented on May 22, 2018

    @JoelMarcey
    Contributor

    I think it would be a great feature to have. I don't know if it is one of our most requested features (like Live Reload was), but still, as translations get more prevalent, it will be. So good to get out ahead of it.

    I'm new to contributing but I plan to contribute to Docusaurus on a longer term.

    ❤️

  7. endiliey commented on May 22, 2018

    @endiliey
    Contributor

    Thanks for the reply. I was just wondering if we should focus more on fixing bugs, refactor or writing more tests to catch regressions, or maybe adding flow (static typechecker) to docusaurus codebase so that there will be less bugs & we can code confidently in the long run.

  8. JoelMarcey commented on May 23, 2018

    @JoelMarcey
    Contributor

    @endiliey Hi! All of what you listed would be wonderful to have 👍 My advice to anyone who wants to contribute to Docusaurus, particularly if there are multiple possible projects/fixes, is to choose ones that you are interested in. That way you are working on something exciting to you and it will probably mean you will want to continue contributing in the future as well.

  9. endiliey commented on Oct 23, 2018

    @endiliey
    Contributor

    Implemented in v2.

    Edit: reopened until we ship
    Edit 2: i18n will only be shipped when we release v2 major (not alpha/beta)

  10. removed
    difficulty: intermediate
    on May 17, 2019
  11. anru commented on May 18, 2019

    @anru
    Contributor

    My use case: I want to have documentation in russian in docs, and use russian as a source language for another languages.

    So write-translations should peek-up preconfigured language instead of having hard-coded "en" string.

  12. shawntabrizi commented on Jun 17, 2019

    @shawntabrizi
    Contributor

    This may be slightly unrelated to this specific issue, but I wanted to ask if there any changes planned related to the path used for localized docs?

    For example, the homepage is: https://homepage.com/en/ but the docs are then at https://homepage.com/docs/en/

    I would expect it to be at https://homepage.com/en/docs

  13. added
    v1
    on Jun 5, 2020
  14. slorber commented on Aug 20, 2020

    @slorber
    Collaborator

    Here is an issue for i18n in v2 where we'll try to fix problems reported in this issue.

    #3317

  15. vthirupathi commented on Nov 11, 2020

    @vthirupathi

    Hi, I'm interested in implementing this. Is it still a desired feature?

  16. slorber commented on Nov 12, 2020

    @slorber
    Collaborator

    hi @vthirupathi , we won't implement this in v1, and it's already implemented for v2 in a pending PR.

    Closing this issue

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

    featurev1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions