redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Add the ability to change the display language

Open alaincroisetiere opened this issue 6 years ago • 28 comments

Would it be possible to add the ability to change the display language of ReDoc UI?

alaincroisetiere avatar Oct 31 '17 20:10 alaincroisetiere

@alaincroisetiere great suggestion and sorry for the long reply! Let's try to address it after 2.0 release! Would you mind helping with this? I can ping you once I'm done with 2.0!

RomanHotsiy avatar Nov 10 '17 11:11 RomanHotsiy

Hello, I had confused the previous issue. How do I change the Redoc language? Even if it is manually.

danielsalles avatar Nov 10 '17 12:11 danielsalles

@danielsalles It's not supported by ReDoc yet.

Even if it is manually

You can fork the repo and change all the texts in source files manually and then build the bundle but I would not recommend this approach and wait until official support for localization!

RomanHotsiy avatar Nov 10 '17 12:11 RomanHotsiy

@RomanGotsiy I would like to help with the translations. You can ping me once the 2.0 release is ready :smiley:

bandantonio avatar Dec 13 '17 08:12 bandantonio

@bandantonio thanks! Will definitely ping once it's done!

RomanHotsiy avatar Dec 13 '17 14:12 RomanHotsiy

I think we need to clarify, is the goal of these API providers:

  1. Single non-English language support.
  2. Multiple language support.

It seems single non-English language support can be solved by ReDoc translating text (eg Response, Required, etc...).

It seems that multi-language support for a single spec definition needs to somehow be also solved inside the definition.

adamaltman avatar Dec 25 '17 14:12 adamaltman

Hello! Any news with the translation? It is very useful feature. Maybe I can help with the translation?

winlx avatar Jan 30 '18 08:01 winlx

In our case we have a single non-english language (need to provide documentation in Dutch)

Are there any plans for this, any started PRs or ideas on how to proceed?

CumpsD avatar Jul 25 '18 13:07 CumpsD

Are there any plans for this,

yes, this is planned but no concrete estimates yet

any started PRs or ideas on how to proceed?

Not any I am aware of.

or ideas on how to proceed?

I would write some more lightweight analog of https://github.com/yahoo/react-intl. react-intl has features that are not-essential for redoc (number formatting, pluralize and other).

RomanHotsiy avatar Jul 26 '18 10:07 RomanHotsiy

Do we have any news about this?

ArthNRick avatar Sep 04 '18 17:09 ArthNRick

I would like to help for Turkish language

suadev avatar Sep 19 '18 13:09 suadev

help for chinese

JoveYu avatar May 14 '19 08:05 JoveYu

Update:

Recently I added labels config option to ReDoc which can be used to implement translations. But it covers very few labels for now.

Help with finishing this would be appreciated!

RomanHotsiy avatar May 14 '19 11:05 RomanHotsiy

For reference, this was introduced in https://github.com/Rebilly/ReDoc/commit/b0e660e

@RomanGotsiy I will try to send some PRs for this next month when I pickup our ReDoc project again to migrate to the latest :)

CumpsD avatar May 14 '19 23:05 CumpsD

any updates?

Nerzal avatar Jul 16 '19 07:07 Nerzal

Hello. It will be a wonderful feature. However, it seems to be easy, because it is necessary to change messages and is provided by OpenAPI file him-self

gigaga avatar Nov 07 '19 11:11 gigaga

Good to hear it have been taken into consideration now... Really appreciate this as a Chinese developer.

BTW, I once worked for a game localization organization. And I think the best way to make ReDoc multi-language is use some automatic tool (I once discover this kind of tool accidentally, but have forgotten) to extract string from the source code, transform these string into some translation-specific representation, then use some volunteer-crowdsourcing translation platform like Serge, Transifex (the organization I worked for use Weblate, but I think it's not nice enough) to translate them.

This kind of pipeline has helped thousands of open-source project to be multi-language, including Semantic UI.

Ray-Eldath avatar Dec 27 '19 12:12 Ray-Eldath

Any news on this?

Dennis-Petrov avatar Feb 25 '20 09:02 Dennis-Petrov

huge bump on this +1000 this is extremely needed

handhikadj avatar Nov 04 '20 14:11 handhikadj

Let's add this to the roadmap after we release v2. See #1292 . I should probably make a separate tracking issue for the longer-term.

adamaltman avatar Nov 04 '20 14:11 adamaltman

Any news for this ?

Shivansh-Mittal avatar Jun 19 '22 13:06 Shivansh-Mittal

Is there any news?

bulychev avatar Jul 22 '22 09:07 bulychev

Any updates ?

C4st3ll4n avatar Oct 20 '22 16:10 C4st3ll4n

+1

xdkaka avatar Nov 15 '22 02:11 xdkaka

Hey, I'd like to know any news on this topic 👍

tedmed avatar Nov 22 '22 13:11 tedmed

As of v2.0.0, there is a new internal service loading some of the labels.

The service is configured by the usage of a labels option from the Redoc.init method.

const labels = {
  enum: 'Enum',
  enumSingleValue: 'Value',
  enumArray: 'Items',
  default: 'Default',
  deprecated: 'Deprecated',
  example: 'Example',
  examples: 'Examples',
  recursive: 'Recursive',
  arrayOf: 'Array of ',
  webhook: 'Event',
  const: 'Value',
  noResultsFound: 'No results found',
  download: 'Download',
  downloadSpecification: 'Download OpenAPI specification',
  responses: 'Responses',
  callbackResponses: 'Callback responses',
  requestSamples: 'Request samples',
  responseSamples: 'Response samples',
};

Redoc.init(specUrl, {labels}, redocElement);

The labels are taken from the label service file. https://github.com/Redocly/redoc/blob/5fb4daa618bb6911ff566530001f1320d818134e/src/services/Labels.ts#L3-L22

Note that I'm using the standalone version and am not a contributor of the project in anyway.

stefgodin avatar Nov 25 '22 19:11 stefgodin

Has there been any updates on this? I am very sure many people would like to have the documentation in multiple languages with the ability to switch between them.

oskr27 avatar Apr 12 '23 03:04 oskr27

As of v2.0.0, there is a new internal service loading some of the labels.

Where is this documented? I don't see a labels option here: https://redocly.com/docs/redoc/config/

allanlewis avatar Dec 20 '23 11:12 allanlewis