Skip to content

Commit 05bd881

Browse files
Steve Ashbygitbook-bot
authored andcommitted
GITBOOK-79: Copy updates proposal on autotranslate GH action guide
1 parent 01826f9 commit 05bd881

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

docs/getting-started/guides/use-github-actions-to-translate-gitbook-pages.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,61 @@
22

33
### Overview
44

5-
As far as any good documentation goes, it's accessibility plays a big part of how useful it can be—and [Internationalization](https://en.wikipedia.org/wiki/Internationalization\_and\_localization) (i18n) has a big part to do with that. 
5+
As far as any good documentation goes, accessibility and [Internationalization](https://en.wikipedia.org/wiki/Internationalization\_and\_localization) (i18n) specifically — plays an important role. 
66

7-
Translating documents and content has always been a rough and manual task - and many times translating documents from one language to another aren't completely straightforward. Luckily, we're able to start using new and emerging tools to help us make our documents more accessible. 
7+
Translating documents and content has always been a tedious and manual task. Many times translating documents from one language to another isn’t straightforward. Luckily, were able to start using new and emerging tools to help us make our documents more accessible. 
88

9-
While GitBook doesn't have a built in translation solution, our Integration Platform allows you to extend the way you manage your content - including allowing you to introduce workflows that take the manual part out of translating your work.
9+
While GitBook doesnt have a native translation solution, our [Integration Platform](https://www.gitbook.com/integrations) allows you to extend the way you manage your content. And that includes the ability to introduce workflows that take the manual aspect out of translating content.
1010

11-
Let's dive in!
11+
Lets dive in!
1212

1313
### Collections
1414

15-
In order for you to start translating your site, you'll need to have some content, and make sure it's organized! 
15+
In order to translate your site, youll need to have some well-organized content. GitBook provides the perfect solution to structure sites available in multiple languages: [collections](https://docs.gitbook.com/content-creation/content-structure/what-is-a-collection).
1616

17-
GitBook provides the perfect solution for you to organize your content in different languages - [Collections](https://docs.gitbook.com/content-creation/content-structure/what-is-a-collection)! 
17+
Collections provide a way to group related spaces together. In the context of i18n, we will use one space for each language, with a space designated to hold the content in the primary language. You can think of this space as your “main” content.
1818

19-
Collections allow you to create a "folder" of sorts, that you can add different spaces to! In our case, we can think of 1 space equal to 1 language.
19+
Here’s an example of such a setup:
2020

21-
To create a collection in [GitBook](https://app.gitbook.com/), head to the blue button in the lower left corner!
22-
23-
You'll need to have a space inside a collection for every language you want to translate into, but only one space in the collection with content in it - you can think of this space as your "main" content.
24-
25-
Your setup might look something like this:
21+
<div data-full-width="false">
2622

2723
<figure><img src="../../.gitbook/assets/Screenshot 2023-05-23 at 10.45.16.png" alt=""><figcaption><p>A collection with different spaces for each language</p></figcaption></figure>
2824

29-
In the example above, the space called "_English_" is the main space that all the translations will come from.
25+
</div>
26+
27+
In the example above, the space called _English_ is the main space that all the translations will be based on.
3028

31-
After you have a collection set up with different spaces, you're then able to use another powerful feature in GitBook that gives you more control over the content you're working on.
29+
After you’ve set up the collection, you can use Git Sync to enable programmatic access to content.
3230

3331
### GitSync
3432

3533
[GitSync](https://docs.gitbook.com/product-tour/git-sync) is a feature in GitBook that allows you to connect a space to a remote repository hosted on either GitHub or GitLab (_starting to Git the hang of it?_).
3634

37-
This guide won't go deep into setting up GitSync, but you can check out our setup video to learn more about [configuring GitSync in your Space](https://www.youtube.com/watch?v=Fm5hYBsRSXo).
35+
You can check [out our setup video](https://www.youtube.com/watch?v=Fm5hYBsRSXo) to learn more about configuring GitSync in your Space.
3836

3937
{% hint style="warning" %}
40-
It's important to note that while you will have multiple spaces set up in GitBook for each language, you'll need to connect each space separately to your remote repository.
38+
**Important:** While your collection will include a space for each language in GitBook, youll need to connect each one to your remote repository separately.
4139
{% endhint %}
4240

43-
You can make use of the [Monorepo feature](https://docs.gitbook.com/product-tour/git-sync/monorepos) to configure each space to a specific folder or directory in your remote repository.
41+
Use the [Monorepo feature](https://docs.gitbook.com/product-tour/git-sync/monorepos) if you need to configure each space to a specific folder in your remote repository.
4442

45-
Now that you have your GitBook project set up to a remote repository, you can explore some of the ways you can add workflows on top of your content.
43+
Once you’ve connected your GitBook spaces to a remote repository, we’ll run through how to add workflows on top of your content.
4644

4745
### GitHub Actions
4846

49-
In this guide, we'll be exploring a workflow setup in GitHub - [GitHub Actions](https://github.com/features/actions).
47+
In this guide, well configure a workflow in GitHub using [GitHub Actions](https://github.com/features/actions).
5048

5149
{% hint style="info" %}
52-
If you're using GitLab, you'll want to explore their [built in CI/CD](https://docs.gitlab.com/ee/ci/) feature.
50+
If youre using GitLab, you can use their [built in CI/CD](https://docs.gitlab.com/ee/ci/) feature.
5351
{% endhint %}
5452

55-
GitHub Actions allow you to run scripts or other utilities when certain things happen in a remote repositoryIn our case, when a new update is made to the content!&#x20;
53+
GitHub Actions allow you to run scripts or other utilities when certain events occur in a remote repository. In this case, we want to run an action every time someone makes a new update to the content.
5654

57-
If you have GitSync enabled with GitHub, any update you make in GitBook is automatically committed to your main branch in GitHub, allowing you to tap into the update through GitHub actions.
55+
Once you’ve configured Git Sync, any update you make in GitBook is automatically committed to the GitHub branch you configured, allowing you to tap into the update using GitHub Actions.
5856

59-
You'll need to configure this by adding a `.github/workflows/action.yml` file at the root of your project.
57+
To configure the GitHub Action, you can add a `.github/workflows/action.yml` file at the root of your project.
6058

61-
An example file looks something like this:
59+
Here’s an example `action.yml` file:
6260

6361
<pre class="language-yaml"><code class="lang-yaml"># This is a basic workflow to help you get started with Actions
6462
<strong>name: GitHub Actions
@@ -75,52 +73,52 @@ jobs:
7573
- uses: actions/checkout@v3
7674
</code></pre>
7775

78-
The example above will run every time an update is merged to main—In GitBook terms, this means any time a [Change Request](https://docs.gitbook.com/collaboration/collaboration/change-requests) is merged.&#x20;
76+
The example action above will run every time someone merges an update to the `main` branch — which means whenever someone merges a [change request](https://docs.gitbook.com/collaboration/collaboration/change-requests) in GitBook.&#x20;
7977

80-
Because this workflow runs after the content is merged, it will contain up to date information about the request, including the latest version of the content.&#x20;
78+
Because this workflow runs after the content is merged, it will contain up-to-date information about the request, including the latest version of the content.&#x20;
8179

82-
From here, you can set up a tool that will handle the translations!
80+
You can now use this action to invoke a tool that will handle the translations.
8381

8482
### Translation Software
8583

86-
The power of having your workflow setup in code comes down to it's flexibility - you have the choice of what tool you'd like to use to handle the translations. Here are some AI tools we've seen used:
84+
The power of having your workflow set up in code comes down to its flexibility you have the choice of what tool youd like to use to handle the translations. For example, you could use one of these AI tools, which can automate translations:
8785

8886
* [DeepL](https://www.deepl.com/)
8987
* [OpenAI](https://openai.com/)
9088
* [Google Cloud Translations](https://cloud.google.com/translate)
9189

92-
Each of the tools above comes with it's Pro's and Con's—For example, some might provide better translations, but come at a higher cost. Some might have easier APIs to work with as well. The next sections covers some important things to keep in mind when choosing a tool for your translations.
90+
Each of the tools above comes with pros and cons. For example, some might provide better translations, but come at a higher cost, which others might have APIs that are easier to work with. The following sections cover some important things to keep in mind when choosing a tool for your translations.
9391

9492
### Considerations
9593

96-
As you choose a tool to do the translations, you'll also be responsible for setting up the utility that handles the translation itself. Here are some things to keep in mind:
94+
As you choose a tool for translations, youll also be responsible for setting up the utility that handles the translation itself. Here are some things to keep in mind:
9795

9896
**Cost**
9997

100-
The cost of the tool you use is a big thing to keep in mind. While some tools provide a free plan to get started with, many translation tools require a paid plan in order to use for more than demo purposes.&#x20;
98+
The cost of the tool you use is an important factor. While some tools provide a free plan to get you started, many translation tools require a paid plan in order to use them beyond demo purposes.&#x20;
10199

102-
It's also important to think about the number of requests being made - is your team making a lot of changes to your content? Should your content be re-translated every time the content is updated?Should it be updated on a schedule?&#x20;
100+
Its also important to think about the number of requests: is your team making a lot of changes to your content? Should your content be re-translated every time the content is updated? Should it be updated on a schedule?&#x20;
103101

104-
**Requests**
102+
**Scope of changes**
105103

106-
If your team is making many requests, you'll want to think about how your translations are handled. For instance, if you only update one page, you will want to make sure your utility is only translating that specific page, instead of re-translating your entire site.
104+
If your team is making lots of isolated changes, youll need to adapt your strategy to handle translations. For instance, if you only update a single page, make sure your utility is only translating that specific page — not the entire space.
107105

108-
**Reviewing Content**
106+
**Reviewing content**
109107

110-
While translation APIs are getting better each day, they're not perfect—And in many cases you'll want to have someone reviewing the translations that are made.
108+
While translation APIs are getting better each day, theyre not perfect — and in many cases youll want to have someone to review the translations.
111109

112-
You'll want to think about how the translated documents are submitted back into the main content. Should they be introduced in the form of a pull request, so your team can review the translations first?
110+
Think about how the translated documents are submitted back into the main content. Should they be introduced in the form of a pull request, so your team can review the translations first?
113111

114-
It's also important to keep in mind, that if an already reviewed translated page is updated in the main branch and you re-translate the page, it might not include the original reviewed translations. You'll be responsible for making sure the translated documents are up to date with the version you're happy with.
112+
Its also important to keep in mind that if someone reviews a translated page, and it’s updated in the main branch, it will be translated again automatically, losing the changes from the review. Youll be responsible for making sure the translated documents are up to date with the version that youre happy with.
115113

116114
**Maintenance**
117115

118-
As with any project, maintenance is another key area of focus. You'll want to make sure you have appropriate resources for not only hooking up all the pieces, but to maintain your project in case things change, like updates to any of the utilities or tools you're using.
116+
As with any project, maintenance is another key area of focus. You need to make sure that once the original setup is implemented, you maintain it in case any part involved in the solution changes, such as updates done to the tools youre using.
119117

120118
### Wrapping up
121119

122-
GitBook allows you to extend the way you work by offering a flexible way of enhancing it's native workflows. On top of working with the workflows and actions mentioned in this guide, GitBook's Integration Platform provides a set of tools that give you even more control over your content.&#x20;
120+
GitBook lets you extend your workflows by seamlessly integrating with Git providers like GitHub or GitLab. On top of working with the workflows and actions mentioned in this guide, GitBooks Integration Platform provides a set of tools that give you even more control over your content.&#x20;
123121

124-
From our REST API to creating custom blocks in GitBook, you're able to integrate many of the tools you already know and love directly into the sites you're working on.
122+
From our REST API to creating custom blocks in GitBook, you can integrate many of the tools you already know and love directly into your sites.
125123

126-
Make sure you head to [GitBook Integrations](https://www.gitbook.com/integrations) to learn more.
124+
Make sure you head to [GitBook Integrations](https://www.gitbook.com/integrations) to learn more!

0 commit comments

Comments
 (0)