Skip to content

Commit 27ec2aa

Browse files
vi-nastyaKirill Bolotskyppcano
authored
i18n for guides (#211)
* 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]>
1 parent 8901578 commit 27ec2aa

File tree

330 files changed

+42895
-1458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+42895
-1458
lines changed

.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
"styles",
6666
"svg",
6767
"templates",
68-
"utils"
68+
"utils",
69+
"contexts",
70+
"i18n",
6971
]
7072
}
7173
],

gatsby-config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ const plugins = [
143143
}
144144
}`,
145145
exclude: [
146+
'/es',
147+
'/es/*',
148+
'/es/*/*',
149+
'/es/*/*/*',
150+
'/es/*/*/*/*',
151+
'/es/*/*/*/*/*',
146152
'/dev-404-page',
147153
'/404',
148154
'/404.html',
@@ -277,7 +283,7 @@ module.exports = {
277283
siteDescription:
278284
// eslint-disable-next-line max-len
279285
'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.',
280-
siteImage: '/images/landscape-icon.png',
286+
siteImage: '/images/k6-cover-image.png',
281287
siteLanguage: 'en',
282288
siteUrl: process.env.GATSBY_DEFAULT_MAIN_URL,
283289
authorName: 'k6',

0 commit comments

Comments
 (0)