You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/guides/use-github-actions-to-translate-gitbook-pages.md
+40-42Lines changed: 40 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,63 +2,61 @@
2
2
3
3
### Overview
4
4
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. 
6
6
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, we’re able to start using new and emerging tools to help us make our documents more accessible. 
8
8
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 doesn’t 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.
10
10
11
-
Let's dive in!
11
+
Let’s dive in!
12
12
13
13
### Collections
14
14
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, you’ll 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).
16
16
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.
18
18
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:
20
20
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
+
<divdata-full-width="false">
26
22
27
23
<figure><imgsrc="../../.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>
28
24
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.
30
28
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.
32
30
33
31
### GitSync
34
32
35
33
[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?_).
36
34
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.
38
36
39
37
{% 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, you’ll need to connect each one to your remote repository separately.
41
39
{% endhint %}
42
40
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.
44
42
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.
46
44
47
45
### GitHub Actions
48
46
49
-
In this guide, we'll be exploring a workflow setup in GitHub -[GitHub Actions](https://github.com/features/actions).
47
+
In this guide, we’ll configure a workflow in GitHub using[GitHub Actions](https://github.com/features/actions).
50
48
51
49
{% 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 you’re using GitLab, you can use their [built in CI/CD](https://docs.gitlab.com/ee/ci/) feature.
53
51
{% endhint %}
54
52
55
-
GitHub Actions allow you to run scripts or other utilities when certain things happen in a remote repository—In our case, when a new update is made to the content! 
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.
56
54
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.
58
56
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.
60
58
61
-
An example file looks something like this:
59
+
Here’s an example `action.yml` file:
62
60
63
61
<preclass="language-yaml"><codeclass="lang-yaml"># This is a basic workflow to help you get started with Actions
64
62
<strong>name: GitHub Actions
@@ -75,52 +73,52 @@ jobs:
75
73
- uses: actions/checkout@v3
76
74
</code></pre>
77
75
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. 
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. 
79
77
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. 
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. 
81
79
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.
83
81
84
82
### Translation Software
85
83
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 you’d like to use to handle the translations. For example, you could use one of these AI tools, which can automate translations:
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.
93
91
94
92
### Considerations
95
93
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, you’ll also be responsible for setting up the utility that handles the translation itself. Here are some things to keep in mind:
97
95
98
96
**Cost**
99
97
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. 
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. 
101
99
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? 
100
+
It’s 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? 
103
101
104
-
**Requests**
102
+
**Scope of changes**
105
103
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, you’ll 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.
107
105
108
-
**Reviewing Content**
106
+
**Reviewing content**
109
107
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, they’re not perfect — and in many cases you’ll want to have someone to review the translations.
111
109
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?
113
111
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
+
It’s 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. You’ll be responsible for making sure the translated documents are up to date with the version that you’re happy with.
115
113
116
114
**Maintenance**
117
115
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 you’re using.
119
117
120
118
### Wrapping up
121
119
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. 
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, GitBook’s Integration Platform provides a set of tools that give you even more control over your content. 
123
121
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.
125
123
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