Skip to content

Commit

Permalink
i18n for guides (#211)
Browse files Browse the repository at this point in the history
* refactor: restructured utils module

Now there are two separate modules: one include general functions, another node-specific

* refactor: decomposed createDocPages function to ease future modifications

* fix: resolved bugs caused by refactoring

* fix: show correct sidebar and breadcrumbs for spanish pages

* feat: adds spanish version for guides and translations for sidebar, slugs and breadcrumbs

* feat: add lins to page translations - wip

* feat: add stub pages translations

* feat: translate guides page content - POC

* chore: disable i18n in production

* feat: add hreflang for doc pages

* feat: add language switcher to header, redirect doc pages and guides page

* feat: add translations for stub pages

* fix: remove old /guides folder, remove /en prefix for english pages

* fix: highlight active page in sidebar

* fix: handle pages with hideFromSidebar: true

* fix: store correct paths while building sidebar tree

* feat: redirect getting-started/welcome page to / or /es based on language

* fix: remove /en prefix from breadcrumbs links

* feat: change top-level guides link label based on chosen locale

* feat: add context to handle language switching

* refactor: move contexts to a separate folder

* fix: in header nav use locale from context instead of localStorage

* feat: change guides link based on chosen locale in mobile nav

* feat: add responsive styles for language switcher

* feat: change 'suggest edits' button text based on chosen locale

* fix: only use localStorage on client side

* fix: fix redirect on language change

* fix: redirect to translated version on link click

* fix: change logo link based on chosen locale

* feat: add all guides subsections

* fix(styles): update language toggle styles

* feat: add noindex robot tag for es pages

* feat: exclude spanish pages from sitemap

* feat: remove /es pages from algolia indicies

* fix: fix build

* feat: add noindex meta tag for stub pages

* fix: hide language toggle on all pages except guides

* feat: add noindex meta tag for /es page

* refactor: remove explicitly setting only EN and ES locale options in gatsby-node, add checks to avoid build failure when no translation is available for a page

* feat: replace special characters with latin characters in localized URLs

* refactor: add translatePathPart helper function

* fix: only make sidebar section titles clickable if they have corresponding .md files

* refactor: delete removeGuides helper since we don't have /guides folder in docs anymore and it won't appear in slugs

* refactor: move getSlug and getTranslatedSlug to utils

* fix: save url language in local storage if there is no value for it yet

* fix: fix /es page bug after refactoring

* refactor: remove DISABLE_I18N flag from gatsby-node

* refactor: replace console.log with reporter.warn in gatsby-node

* refactor: remove console.log

* fix: fix minor bugs after refactoring

* fix: add comment about algolia

* refactor: add comments on i18n

* refactor: move i18n config and translations to a separate folder

* feat: add i18n keys for Features and Use Cases sections at the Welcome page

* refactor: throw error if no english translation was found for an i18n key

* fix: change i18n-config export to fix build

* fix: remove changing top-level guides link text to guias

* fix: disable using locale from local storage when language toggle is hidden (for testing /es translations)

* feat: add i18n-config flag for enabling noindex tag

* fix: get rid of optional chaining in gatsby-node

* ES loc: Getting started

* ES Translation: WIP Using k6

* ES: WIP translate Guides Homepage

* ES translation: WIP Using k6

* ES translations: Completed Using k6 + Test Authoring

* ES translation: Test Types

* ES: translate Manifesto and What k6 does not on Guides homepage

* ES - WIP Results visualizations

* ES - WIP Test types

* ES - Misc guides

* ES: fix lint:prose

* ES - Testing Guides

* ES - final details (update latest docs)

* ES - minor detail

* ES - minor homepage changes

* feat: add ES SEO title and description for /es page

* Disable `higLangugeToogle and disableRedirect`

* Change cover image

* ES: minor grammar changes

* ES - Comunidad page - content tweaks

* ES - disable hide settings

Co-authored-by: Kirill Bolotsky <[email protected]>
Co-authored-by: Pepe Cano <[email protected]>
  • Loading branch information
3 people authored Mar 30, 2021
1 parent 8901578 commit 27ec2aa
Show file tree
Hide file tree
Showing 330 changed files with 42,895 additions and 1,458 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"styles",
"svg",
"templates",
"utils"
"utils",
"contexts",
"i18n",
]
}
],
Expand Down
8 changes: 7 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ const plugins = [
}
}`,
exclude: [
'/es',
'/es/*',
'/es/*/*',
'/es/*/*/*',
'/es/*/*/*/*',
'/es/*/*/*/*/*',
'/dev-404-page',
'/404',
'/404.html',
Expand Down Expand Up @@ -277,7 +283,7 @@ module.exports = {
siteDescription:
// eslint-disable-next-line max-len
'Docs k6 is an open source developer-centric load and performance regression testing tool for cloud native APIs, microservices and web sites/apps. Tests are written in ES6 JS with support for HTTP/1.1, HTTP/2.0 and WebSocket protocols.',
siteImage: '/images/landscape-icon.png',
siteImage: '/images/k6-cover-image.png',
siteLanguage: 'en',
siteUrl: process.env.GATSBY_DEFAULT_MAIN_URL,
authorName: 'k6',
Expand Down
Loading

0 comments on commit 27ec2aa

Please sign in to comment.