Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add internationalization #13066

Merged
merged 9 commits into from
Oct 3, 2018
Merged

[docs] Add internationalization #13066

merged 9 commits into from
Oct 3, 2018

Conversation

mbrookes
Copy link
Member

@mbrookes mbrookes commented Oct 1, 2018

This PR provides the ability to render localized versions of the documentation markdown files, according to the user's language preferences.

Note: API docs and a handful repo "README" based pages are not currently supported. This is by design - API docs translation will be phase two, once we have proven the approach against structurally simpler (from a markdown perspective) files.

#9511

@@ -7,6 +7,9 @@ import AppWrapper from 'docs/src/modules/components/AppWrapper';
import initRedux from 'docs/src/modules/redux/initRedux';
import findPages from /* preval */ 'docs/src/modules/utils/findPages';
import { loadCSS } from 'fg-loadcss/src/loadCSS';
import acceptLanguage from 'accept-language';

acceptLanguage.languages(['en', 'zh']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest we constrain this to en for now, get the CrowdIn l10n branch going to accept ,Chinese translations, and once we have critical mass, add zh back. We could then add a "request for translation" (with a link to CrowdIn) at the top of any *-zh.md that are still in English.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a menu to switch better the different languages? I think that shipping the en and zh languages with an edit button would help a lot engaging the Chinese community in the translation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, but offering an alternative translation when there is none is a false promise, which ever way it's enabled. Better to start with the users who have offered to translate, and a notification based call-to-action first, then make it live when there is some substance, and proof of future intent for others to get behind.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a plan :D

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Oct 1, 2018
@mbrookes
Copy link
Member Author

mbrookes commented Oct 1, 2018

I see I broke some things, but I'm 😪 . I'll look again tomorrow.

eps1lon
eps1lon previously requested changes Oct 2, 2018
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you run yarn on ^1.10.0 locally? Otherwise #13055 would be reverted.

This probably won't fix the CI failure but at least it will trigger a rerun.

@mbrookes
Copy link
Member Author

mbrookes commented Oct 2, 2018

Ah, thanks. Wondered what was going on there!

@eps1lon eps1lon dismissed their stale review October 2, 2018 21:07

Resolved

@mbrookes
Copy link
Member Author

mbrookes commented Oct 2, 2018

The prettier error that is breaking ci/circleci: test_unit reminds me of one we've seen before, but I can't remember to root cause...

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 3, 2018

@mbrookes The error was clearer before when using eslint to run prettier. However, it runs faster with the new approach @eps1lon is using. I have run prettier, it should be good.

@mbrookes mbrookes merged commit be342b9 into mui:master Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants