docs: mark some more fields as translatable (#7569)

This commit is contained in:
Joshua Chen 2022-06-05 21:32:43 +08:00 committed by GitHub
parent c03def7d5f
commit 6a5efd068c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 30 deletions

View file

@ -9,7 +9,7 @@ import {
InsertIfCanaryVersionKnown, InsertIfCanaryVersionKnown,
PackageJSONDiff, PackageJSONDiff,
PublishTime, PublishTime,
} from "./Versions.tsx"; } from "@site/src/components/Versions";
<VersionsProvider> <VersionsProvider>
``` ```

View file

@ -7,6 +7,7 @@
/* eslint-disable global-require */ /* eslint-disable global-require */
import {translate} from '@docusaurus/Translate';
import {sortBy} from '@site/src/utils/jsUtils'; import {sortBy} from '@site/src/utils/jsUtils';
/* /*
@ -79,72 +80,102 @@ export type User = {
export const Tags: {[type in TagType]: Tag} = { export const Tags: {[type in TagType]: Tag} = {
// DO NOT USE THIS TAG: we choose sites to add to favorites // DO NOT USE THIS TAG: we choose sites to add to favorites
favorite: { favorite: {
label: 'Favorite', label: translate({message: 'Favorite'}),
description: description: translate({
'Our favorite Docusaurus sites that you must absolutely check-out!', message:
'Our favorite Docusaurus sites that you must absolutely check out!',
id: 'showcase.tag.favorite.description',
}),
color: '#e9669e', color: '#e9669e',
}, },
// For open-source sites, a link to the source code is required // 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! // The source should be your *website's* source, not your project's source!
opensource: { opensource: {
label: 'Open-Source', label: translate({message: 'Open-Source'}),
description: 'Open-Source Docusaurus sites can be useful for inspiration!', description: translate({
message: 'Open-Source Docusaurus sites can be useful for inspiration!',
id: 'showcase.tag.opensource.description',
}),
color: '#39ca30', color: '#39ca30',
}, },
product: { product: {
label: 'Product', label: translate({message: 'Product'}),
description: 'Docusaurus sites associated to a commercial product!', description: translate({
message: 'Docusaurus sites associated to a commercial product!',
id: 'showcase.tag.product.description',
}),
color: '#dfd545', color: '#dfd545',
}, },
design: { design: {
label: 'Design', label: translate({message: 'Design'}),
description: description: translate({
message:
'Beautiful Docusaurus sites, polished and standing out from the initial template!', 'Beautiful Docusaurus sites, polished and standing out from the initial template!',
id: 'showcase.tag.design.description',
}),
color: '#a44fb7', color: '#a44fb7',
}, },
i18n: { i18n: {
label: 'I18n', label: translate({message: 'I18n'}),
description: description: translate({
message:
'Translated Docusaurus sites using the internationalization support with more than 1 locale.', 'Translated Docusaurus sites using the internationalization support with more than 1 locale.',
id: 'showcase.tag.i18n.description',
}),
color: '#127f82', color: '#127f82',
}, },
versioning: { versioning: {
label: 'Versioning', label: translate({message: 'Versioning'}),
description: description: translate({
message:
'Docusaurus sites using the versioning feature of the docs plugin to manage multiple versions.', 'Docusaurus sites using the versioning feature of the docs plugin to manage multiple versions.',
id: 'showcase.tag.versioning.description',
}),
color: '#fe6829', color: '#fe6829',
}, },
// Large sites, with a lot of content (> 200 pages, excluding versions) // Large sites, with a lot of content (> 200 pages, excluding versions)
large: { large: {
label: 'Large', label: translate({message: 'Large'}),
description: description: translate({
message:
'Very large Docusaurus sites, including many more pages than the average!', 'Very large Docusaurus sites, including many more pages than the average!',
id: 'showcase.tag.large.description',
}),
color: '#8c2f00', color: '#8c2f00',
}, },
meta: { meta: {
label: 'Meta', label: translate({message: 'Meta'}),
description: 'Docusaurus sites of Meta (formerly Facebook) projects', description: translate({
message: 'Docusaurus sites of Meta (formerly Facebook) projects',
id: 'showcase.tag.meta.description',
}),
color: '#4267b2', // Facebook blue color: '#4267b2', // Facebook blue
}, },
personal: { personal: {
label: 'Personal', label: translate({message: 'Personal'}),
description: description: translate({
message:
'Personal websites, blogs and digital gardens built with Docusaurus', 'Personal websites, blogs and digital gardens built with Docusaurus',
id: 'showcase.tag.personal.description',
}),
color: '#14cfc3', color: '#14cfc3',
}, },
rtl: { rtl: {
label: 'RTL Direction', label: translate({message: 'RTL Direction'}),
description: description: translate({
message:
'Docusaurus sites using the right-to-left reading direction support.', 'Docusaurus sites using the right-to-left reading direction support.',
id: 'showcase.tag.rtl.description',
}),
color: '#ffcfc3', color: '#ffcfc3',
}, },
}; };

View file

@ -1,5 +1,4 @@
--- ---
id: search
title: Search title: Search
keywords: keywords:
- algolia - algolia

View file

@ -1,5 +1,4 @@
--- ---
id: search
title: Search title: Search
keywords: keywords:
- algolia - algolia