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

feat: Crowdin integration #112

Merged
merged 3 commits into from
Oct 11, 2021
Merged

feat: Crowdin integration #112

merged 3 commits into from
Oct 11, 2021

Conversation

molant
Copy link
Contributor

@molant molant commented Oct 7, 2021

Integrates with Crowdin to enable i18n of the site. This PR changes the
source of truth for Crowdin and moves it to this repository instead of
relying on electron/i18n.

Additionally it uses Crowdin's CLI to do the upload/download of assets
making it more reliable.

The website is built on locale at a time via yarn i18n:build.
Otherwise the process crashed with an out of memory error. The regular
yarn build command still compiles the en locale.

Because we cannot get notifications when there are new translations
avaiable, there is a GitHub workflow (update-i18n-deploy.yml) that
downloads the content every few minutes, builds, and deploy. To speed up
this process, the previous generated assets are download. In local tests
this reduces the build times from 250s to 40s so the whole process
should take about 5 minutes.

The previous generated content is stored in Azure Storage. Because this
is a static website it makes more sense than having a dyno and will make
it easier to:

  • deploy multiple locales at the same time if we still need to speed up
    the process
  • have versioned docs because we just need to "take a snapshot" and
    publish to a different folder

The current live site is still not using this storage but will soon-ish.


Fix #64

@molant molant requested a review from erickzhao October 7, 2021 15:57
@MarshallOfSound MarshallOfSound temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 15:57 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 15:59 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 17:30 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 23:08 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 23:09 Inactive
@molant molant changed the title feat: start crowdin integration feat: Crowdin integration Oct 7, 2021
@molant molant marked this pull request as ready for review October 7, 2021 23:09
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 23:11 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 23:17 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 7, 2021 23:28 Inactive
@molant
Copy link
Contributor Author

molant commented Oct 7, 2021

@erickzhao the markdown changes add an automatic description to a bunch of documents that didn't have one and I think they can be ignored. I split the PR into 2 commits so it's easier to review.

@molant
Copy link
Contributor Author

molant commented Oct 7, 2021

One thing to investigate is how docsearch and locales work.

@molant
Copy link
Contributor Author

molant commented Oct 7, 2021

One thing to investigate is how docsearch and locales work.

From what I'm reading having contextualSearch: true in docusaurus.config.js is enough. Will see 😊

@molant molant requested a review from ckerr October 7, 2021 23:34
This was referenced Oct 7, 2021
@molant molant force-pushed the main branch 2 times, most recently from 60000eb to 3527526 Compare October 8, 2021 16:59
molant added 2 commits October 8, 2021 10:42
Integrates with Crowdin to enable i18n of the site. This PR changes the
source of truth for Crowdin and moves it to this repository instead of
relying on `electron/i18n`.

Additionally it uses Crowdin's CLI to do the upload/download of assets
making it more reliable.

The website is built on locale at a time via `yarn i18n:build`.
Otherwise the process crashed with an out of memory error. The regular
`yarn build` command still compiles the `en` locale.

Because we cannot get notifications when there are new translations
avaiable, there is a GitHub workflow (`update-i18n-deploy.yml`) that
downloads the content every few minutes, builds, and deploy. To speed up
this process, the previous generated assets are download. In local tests
this reduces the build times from 250s to 40s so the whole process
should take about 5 minutes.

The previous generated content is stored in Azure Storage. Because this
is a static website it makes more sense than having a dyno and will make
it easier to:
- deploy multiple locales at the same time if we still need to speed up
  the process
- have versioned docs because we just need to "take a snapshot" and
  publish to a different folder

The current live site is still not using this storage but will soon-ish.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #64
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 8, 2021 17:42 Inactive
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 8, 2021 18:02 Inactive
.github/workflows/en-deploy.yml Show resolved Hide resolved
docusaurus.config.js Show resolved Hide resolved
Disable the dropdown until we finish the migration from Heroku Dyno to
Azure Storage. The reason is that the localized content will only be
available in Azure so users will end up in 404 pages when visiting other
locales.
@molant molant temporarily deployed to electronjsorg-new-pr-112 October 9, 2021 00:39 Inactive
@molant molant merged commit eee9bb9 into main Oct 11, 2021
@molant molant deleted the crowdin branch October 20, 2021 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internationalization
3 participants