Merge pull request #353 from automatisch/docs/slack-connection-guide
docs: Add setup guide for slack connection
This commit is contained in:
@@ -4,85 +4,15 @@ sidebar_position: 3
|
|||||||
|
|
||||||
# Slack
|
# Slack
|
||||||
|
|
||||||
Let's translate `docs/intro.md` to French.
|
1. Go to the [link](https://api.slack.com/apps?new_app=1) to **create an app** on Slack API.
|
||||||
|
2. Select **From scratch**.
|
||||||
## Configure i18n
|
3. Enter **App name**.
|
||||||
|
4. Pick the workspace you would like to use with the Slack connection.
|
||||||
Modify `docusaurus.config.js` to add support for the `fr` locale:
|
5. Click on **Create App** button.
|
||||||
|
6. Click the **Permissions** card on the **Add features and functionality** section.
|
||||||
```js title="docusaurus.config.js"
|
7. Go to **Bot Token Scopes** and add the necessary scopes. ([more info](https://api.slack.com/scopes?filter=granular_bot))
|
||||||
module.exports = {
|
8. Go to **OAuth Tokens for Your Workspace** and click **Install to Workspace**.
|
||||||
i18n: {
|
9. In **Where should Sample post?** section, select the channel you would like to use with Automatisch, and click **Allow**.
|
||||||
defaultLocale: 'en',
|
10. Copy **Bot User OAuth Token** and paste it to **Access Token** on the Automatisch page.
|
||||||
locales: ['en', 'fr'],
|
11. Click **Submit** button on Automatisch.
|
||||||
},
|
12. Now, you can start using the Slack connection with Automatisch.
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Translate a doc
|
|
||||||
|
|
||||||
Copy the `docs/intro.md` file to the `i18n/fr` folder:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/
|
|
||||||
|
|
||||||
cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
|
|
||||||
```
|
|
||||||
|
|
||||||
Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French.
|
|
||||||
|
|
||||||
## Start your localized site
|
|
||||||
|
|
||||||
Start your site on the French locale:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run start -- --locale fr
|
|
||||||
```
|
|
||||||
|
|
||||||
Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated.
|
|
||||||
|
|
||||||
:::caution
|
|
||||||
|
|
||||||
In development, you can only use one locale at a same time.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Add a Locale Dropdown
|
|
||||||
|
|
||||||
To navigate seamlessly across languages, add a locale dropdown.
|
|
||||||
|
|
||||||
Modify the `docusaurus.config.js` file:
|
|
||||||
|
|
||||||
```js title="docusaurus.config.js"
|
|
||||||
module.exports = {
|
|
||||||
themeConfig: {
|
|
||||||
navbar: {
|
|
||||||
items: [
|
|
||||||
// highlight-start
|
|
||||||
{
|
|
||||||
type: 'localeDropdown',
|
|
||||||
},
|
|
||||||
// highlight-end
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
The locale dropdown now appears in your navbar:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Build your localized site
|
|
||||||
|
|
||||||
Build your site for a specific locale:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build -- --locale fr
|
|
||||||
```
|
|
||||||
|
|
||||||
Or build your site to include all the locales at once:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
Reference in New Issue
Block a user