Jest: Error in mock-functions doc page of pt-br translate.

Created on 6 May 2018  路  9Comments  路  Source: facebook/jest

馃悰 Bug Report

In line 7 of the second code example in page "https://facebook.github.io/jest/docs/pt-BR/mock-functions.html#propriedade-mock" should be "O segundo argumento da primeira chamada foi 'second arg'", because the code goes down from the explanation refers to the first mock call.

Found

// O segundo argumento da segunda chamada foi 'second arg'
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

Expected

// O segundo argumento da primeira chamada foi 'second arg'
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

Most helpful comment

I fixed error in translation, thank you!

All 9 comments

I can edit this page, but not found in this repository.

The translations live in crowdin, see https://crowdin.com/project/jest

@JoelMarcey is it possible to have Docusaurus link to crowdin for translations?

@SimenB Yes it is possible. See: https://reasonml.github.io/ where if you click on the translation link in the header bar you will see Help Translate?

Look for translationRecruitingLink - https://docusaurus.io/docs/en/site-config.html#optional-fields

I fixed error in translation, thank you!

@JoelMarcey What about the edit button on each site when you're on a translated version - could that link to crowdin?

We should also add the "help translate" link in the list though

@SimenB You mean have the "Edit on GitHub" link that is normally shown link to CrowdIn instead?

Right now we have editUrl which is global - https://docusaurus.io/docs/en/site-config.html#optional-fields

But we also have custom_edit_url that can be used in each doc. https://docusaurus.io/docs/en/doc-markdown.html#documents

Not sure that helps you in this case, but those are the two options we have at this point.

You mean have the "Edit on GitHub" link that is normally shown link to CrowdIn instead?

Yes - or at least have a text under it saying only the English (or "default" to be generic) translation is on github, and to go to crowdin for the other translations.

But we also have custom_edit_url that can be used in each doc.

That has to be hardcoded, right? We cant have it be https://crowdin.com/project/jest/pt-BR for Portuguese and https://crowdin.com/project/jest/ja for the Japanese one? And of course GitHub for the English version.

I can open up a feature request in Docusaurus if you'd like?

@SimenB Yeah, I don't think we have a built-in way to do this currently easily. I haven't thought about this fully yet, but maybe you could do something with some custom React. But maybe there should be a config option called crowdin link that automatically uses the current language to populate. Not sure yet, the best way to do it.

Would you mind filing an issue on this on Docusuarus?

Was this page helpful?
0 / 5 - 0 ratings