Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 481c53f

Browse files
committed
feat: translation set up
1 parent 7407acd commit 481c53f

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

docusaurus.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ const config = {
2424
// to replace "en" with "zh-Hans".
2525
i18n: {
2626
defaultLocale: 'en',
27-
locales: ['en'],
27+
locales: ['en', 'pr'],
28+
localeConfigs: {
29+
en: {
30+
label: 'English',
31+
},
32+
pr: {
33+
label: 'Portuguese',
34+
},
35+
},
2836
},
2937

3038
plugins: ['@docusaurus/theme-live-codeblock', 'docusaurus-plugin-sass'],
@@ -82,6 +90,10 @@ const config = {
8290
type: 'custom-user-navbar-item',
8391
position: 'right',
8492
},
93+
{
94+
type: 'localeDropdown',
95+
position: 'right',
96+
},
8597
],
8698
},
8799
prism: {

i18n-config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const en = {
2+
// language for the root path e.g. for www.deriv.com
3+
is_default: true,
4+
path: 'en',
5+
display_name: 'English',
6+
short_name: 'EN',
7+
affiliate_lang: 0,
8+
};
9+
export const pt = {
10+
path: 'pt',
11+
display_name: 'Português',
12+
short_name: 'PT',
13+
affiliate_lang: 9,
14+
};

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)