Redocly / redoc

📘 OpenAPI/Swagger-generated API Reference Documentation
https://redocly.github.io/redoc/
MIT License
23.29k stars 2.28k forks source link

Add the ability to change the display language #367

Open alaincroisetiere opened 6 years ago

alaincroisetiere commented 6 years ago

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

RomanHotsiy commented 6 years ago

@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!

danielsalles commented 6 years ago

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

RomanHotsiy commented 6 years ago

@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!

bandantonio commented 6 years ago

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

RomanHotsiy commented 6 years ago

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

adamaltman commented 6 years ago

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.

winlx commented 6 years ago

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

CumpsD commented 6 years ago

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?

RomanHotsiy commented 6 years ago

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).

ArthNRick commented 6 years ago

Do we have any news about this?

suadev commented 5 years ago

I would like to help for Turkish language

JoveYu commented 5 years ago

help for chinese

RomanHotsiy commented 5 years ago

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!

CumpsD commented 5 years ago

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 :)

Nerzal commented 5 years ago

any updates?

gigaga commented 4 years ago

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

Ray-Eldath commented 4 years ago

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.

Dennis-Petrov commented 4 years ago

Any news on this?

handhikadj commented 3 years ago

huge bump on this +1000 this is extremely needed

adamaltman commented 3 years ago

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.

Shivansh-Mittal commented 2 years ago

Any news for this ?

bulychev commented 2 years ago

Is there any news?

C4st3ll4n commented 1 year ago

Any updates ?

xdkaka commented 1 year ago

+1

tedmed commented 1 year ago

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

stefgodin commented 1 year ago

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.

oskr27 commented 1 year ago

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.

allanlewis commented 9 months ago

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/