diff --git a/docs/crowdin.yml b/docs/crowdin.yml new file mode 100644 index 000000000..24042688e --- /dev/null +++ b/docs/crowdin.yml @@ -0,0 +1,16 @@ +project_id: '455186' +api_token_env: 'CROWDIN_PERSONAL_TOKEN' +preserve_hierarchy: true +files: [ + # Markdown files for the user manual + { + source: '/docs/manual/**/*', + translation: '/i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name%', + }, + # Docs home page + { + source: '/docs/index.md', + translation: '/i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/%original_file_name%', + }, + + ] diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 1060a56b4..dfb7c57a6 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -8,6 +8,10 @@ module.exports = { favicon: 'img/openrefine_logo.png', organizationName: 'OpenRefine', // Usually your GitHub org/user name. projectName: 'OpenRefine', // Usually your repo name. + i18n: { + defaultLocale: 'en', + locales: ['en', 'jp', 'fr'], + }, themeConfig: { navbar: { title: 'OpenRefine Documentation', @@ -22,12 +26,19 @@ module.exports = { label: 'User Manual', position: 'left', }, - {to: 'technical-reference/technical-reference-index', - label: 'Technical Reference', - position: 'left'}, + { + to: 'technical-reference/technical-reference-index', + label: 'Technical Reference', + position: 'left' + }, + { + type: 'localeDropdown', + position: 'right', + }, { href: 'https://github.com/OpenRefine/OpenRefine/edit/master/docs', - label: 'GitHub', + 'aria-label': 'GitHub', + className: 'header-github-link', position: 'right', }, ], diff --git a/docs/netlify.toml b/docs/netlify.toml new file mode 100644 index 000000000..da425af8b --- /dev/null +++ b/docs/netlify.toml @@ -0,0 +1,9 @@ + +# Note: this file's config overrides the Netlify UI admin config + +[context.production] + command = "yarn netlify:build:production" + +[context.deploy-preview] + command = "yarn netlify:build:deployPreview" + diff --git a/docs/package.json b/docs/package.json index f93481ab8..2448db3d6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,9 +9,13 @@ "start": "docusaurus start", "build": "docusaurus build", "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy" + "deploy": "docusaurus deploy", + "crowdin": "crowdin", + "netlify:build:production": "docusaurus write-translations && crowdin upload && crowdin download && yarn build", + "netlify:build:deployPreview": "docusaurus write-translations && yarn build" }, "dependencies": { + "@crowdin/cli": "3", "@docusaurus/core": "^2.0.0-beta.1", "@docusaurus/preset-classic": "^2.0.0-beta.3", "clsx": "^1.1.1", diff --git a/docs/yarn.lock b/docs/yarn.lock index adda11195..7bcc27947 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1107,6 +1107,13 @@ "@babel/helper-validator-identifier" "^7.12.11" to-fast-properties "^2.0.0" +"@crowdin/cli@3": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@crowdin/cli/-/cli-3.6.0.tgz#67a882c1f15403da0d4492091b812d15ca593234" + integrity sha512-vXycSWnt45bRrV7u6KvvlN0hUm7pXMKlYYDKdRjvvcIFGB3km7WkVXvft9lYOpCH1wHmR7TqjsZQPPQRWqppyA== + dependencies: + shelljs "^0.8.4" + "@docsearch/css@3.0.0-alpha.36": version "3.0.0-alpha.36" resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.0.0-alpha.36.tgz#0af69a86b845974d0f8cab62db0218f66b6ad2d6"