From 584142154c0f761b27e4830a0e59a3f5b7cc5de1 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 5 Jun 2022 16:21:38 +0800 Subject: [PATCH] docs: mark some more fields as translatable --- .../4-canary => src/components}/Versions.tsx | 0 website/src/data/users.tsx | 85 +++++++++++++------ .../version-2.0.0-beta.20/search.md | 1 - .../version-2.0.0-beta.21/search.md | 1 - 4 files changed, 58 insertions(+), 29 deletions(-) rename website/{community/4-canary => src/components}/Versions.tsx (100%) diff --git a/website/community/4-canary/Versions.tsx b/website/src/components/Versions.tsx similarity index 100% rename from website/community/4-canary/Versions.tsx rename to website/src/components/Versions.tsx diff --git a/website/src/data/users.tsx b/website/src/data/users.tsx index 7be07940aedd9..21ccbfaee31a8 100644 --- a/website/src/data/users.tsx +++ b/website/src/data/users.tsx @@ -7,6 +7,7 @@ /* eslint-disable global-require */ +import {translate} from '@docusaurus/Translate'; import {sortBy} from '@site/src/utils/jsUtils'; /* @@ -79,72 +80,102 @@ export type User = { export const Tags: {[type in TagType]: Tag} = { // DO NOT USE THIS TAG: we choose sites to add to favorites favorite: { - label: 'Favorite', - description: - 'Our favorite Docusaurus sites that you must absolutely check-out!', + label: translate({message: 'Favorite'}), + description: translate({ + message: + 'Our favorite Docusaurus sites that you must absolutely check out!', + id: 'showcase.tag.favorite.description', + }), color: '#e9669e', }, // For open-source sites, a link to the source code is required // The source should be your *website's* source, not your project's source! opensource: { - label: 'Open-Source', - description: 'Open-Source Docusaurus sites can be useful for inspiration!', + label: translate({message: 'Open-Source'}), + description: translate({ + message: 'Open-Source Docusaurus sites can be useful for inspiration!', + id: 'showcase.tag.opensource.description', + }), color: '#39ca30', }, product: { - label: 'Product', - description: 'Docusaurus sites associated to a commercial product!', + label: translate({message: 'Product'}), + description: translate({ + message: 'Docusaurus sites associated to a commercial product!', + id: 'showcase.tag.product.description', + }), color: '#dfd545', }, design: { - label: 'Design', - description: - 'Beautiful Docusaurus sites, polished and standing out from the initial template!', + label: translate({message: 'Design'}), + description: translate({ + message: + 'Beautiful Docusaurus sites, polished and standing out from the initial template!', + id: 'showcase.tag.design.description', + }), color: '#a44fb7', }, i18n: { - label: 'I18n', - description: - 'Translated Docusaurus sites using the internationalization support with more than 1 locale.', + label: translate({message: 'I18n'}), + description: translate({ + message: + 'Translated Docusaurus sites using the internationalization support with more than 1 locale.', + id: 'showcase.tag.i18n.description', + }), color: '#127f82', }, versioning: { - label: 'Versioning', - description: - 'Docusaurus sites using the versioning feature of the docs plugin to manage multiple versions.', + label: translate({message: 'Versioning'}), + description: translate({ + message: + 'Docusaurus sites using the versioning feature of the docs plugin to manage multiple versions.', + id: 'showcase.tag.versioning.description', + }), color: '#fe6829', }, // Large sites, with a lot of content (> 200 pages, excluding versions) large: { - label: 'Large', - description: - 'Very large Docusaurus sites, including many more pages than the average!', + label: translate({message: 'Large'}), + description: translate({ + message: + 'Very large Docusaurus sites, including many more pages than the average!', + id: 'showcase.tag.large.description', + }), color: '#8c2f00', }, meta: { - label: 'Meta', - description: 'Docusaurus sites of Meta (formerly Facebook) projects', + label: translate({message: 'Meta'}), + description: translate({ + message: 'Docusaurus sites of Meta (formerly Facebook) projects', + id: 'showcase.tag.meta.description', + }), color: '#4267b2', // Facebook blue }, personal: { - label: 'Personal', - description: - 'Personal websites, blogs and digital gardens built with Docusaurus', + label: translate({message: 'Personal'}), + description: translate({ + message: + 'Personal websites, blogs and digital gardens built with Docusaurus', + id: 'showcase.tag.personal.description', + }), color: '#14cfc3', }, rtl: { - label: 'RTL Direction', - description: - 'Docusaurus sites using the right-to-left reading direction support.', + label: translate({message: 'RTL Direction'}), + description: translate({ + message: + 'Docusaurus sites using the right-to-left reading direction support.', + id: 'showcase.tag.rtl.description', + }), color: '#ffcfc3', }, }; diff --git a/website/versioned_docs/version-2.0.0-beta.20/search.md b/website/versioned_docs/version-2.0.0-beta.20/search.md index d3b27ec96cabc..e4a066e4ffd0d 100644 --- a/website/versioned_docs/version-2.0.0-beta.20/search.md +++ b/website/versioned_docs/version-2.0.0-beta.20/search.md @@ -1,5 +1,4 @@ --- -id: search title: Search keywords: - algolia diff --git a/website/versioned_docs/version-2.0.0-beta.21/search.md b/website/versioned_docs/version-2.0.0-beta.21/search.md index d3b27ec96cabc..e4a066e4ffd0d 100644 --- a/website/versioned_docs/version-2.0.0-beta.21/search.md +++ b/website/versioned_docs/version-2.0.0-beta.21/search.md @@ -1,5 +1,4 @@ --- -id: search title: Search keywords: - algolia