Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polish(v2): Add more tags translations #4275

Merged
merged 2 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/codeTranslations/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"theme.blog.post.paginator.newerPost": "Newer Post",
"theme.blog.post.paginator.olderPost": "Older Post",
"theme.blog.post.readMore": "Read More",
"theme.blog.tags": "Tags:",
"theme.tags.tagsPageLink": "View All Tags",
"theme.tags.tagsPageTitle": "Tags",
"theme.tags.tagsListLabel": "Tags:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like duplicate to me, colon should not be a apart of translation string which will allow to reuse the 18n string.

"theme.CodeBlock.copyButtonAriaLabel": "Copy code to clipboard",
"theme.CodeBlock.copied": "Copied",
"theme.CodeBlock.copy": "Copy",
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/codeTranslations/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"theme.blog.post.paginator.newerPost": "پست های جدید تر",
"theme.blog.post.paginator.olderPost": "پست های قدیمی تر",
"theme.blog.post.readMore": "ادامه مطلب",
"theme.blog.tags": "برچسب ها:",
"theme.tags.tagsPageLink": "مشاهده تمام برچسب ها",
"theme.tags.tagsPageTitle": "برچسب ها",
"theme.tags.tagsListLabel": ":برچسب ها",
"theme.CodeBlock.copyButtonAriaLabel": "کپی کردن کد به کلیپ بورد",
"theme.CodeBlock.copied": "کپی شد",
"theme.CodeBlock.copy": "کپی کردن",
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/codeTranslations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"theme.blog.post.paginator.newerPost": "Article plus récent",
"theme.blog.post.paginator.olderPost": "Article plus ancien",
"theme.blog.post.readMore": "Lire plus",
"theme.blog.tags": "Tags:",
"theme.tags.tagsPageLink": "Voir tous les tags",
"theme.tags.tagsPageTitle": "Tags",
"theme.tags.tagsListLabel": "Tags:",
"theme.CodeBlock.copyButtonAriaLabel": "Copier le code",
"theme.CodeBlock.copied": "Copié",
"theme.CodeBlock.copy": "Copier",
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/codeTranslations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"theme.blog.post.paginator.newerPost": "Следующий пост",
"theme.blog.post.paginator.olderPost": "Предыдущий пост",
"theme.blog.post.readMore": "Читать дальше",
"theme.blog.tags": "Теги:",
"theme.tags.tagsPageLink": "Посмотреть все теги",
"theme.tags.tagsPageTitle": "Теги",
"theme.tags.tagsListLabel": "Теги:",
"theme.CodeBlock.copyButtonAriaLabel": "Скопировать в буфер обмена",
"theme.CodeBlock.copied": "Скопировано",
"theme.CodeBlock.copy": "Скопировать",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function BlogPostItem(props: Props): JSX.Element {
<div className="col">
<strong>
<Translate
id="theme.blog.tags"
description="The label used during output tags list">
id="theme.tags.tagsListLabel"
description="The label alongside a tag list">
Tags:
</Translate>
</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import type {Props} from '@theme/BlogTagsListPage';
import BlogSidebar from '@theme/BlogSidebar';
import Translate from '@docusaurus/Translate';

function getCategoryOfTag(tag: string) {
// tag's category should be customizable
Expand Down Expand Up @@ -61,7 +62,13 @@ function BlogTagsListPage(props: Props): JSX.Element {
<BlogSidebar sidebar={sidebar} />
</div>
<main className="col col--8">
<h1>Tags</h1>
<h1>
<Translate
id="theme.tags.tagsPageTitle"
description="The title of the tag list page">
Tags
</Translate>
</h1>
<div className="margin-vert--lg">{tagsSection}</div>
</main>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import BlogPostItem from '@theme/BlogPostItem';
import Link from '@docusaurus/Link';
import type {Props} from '@theme/BlogTagsPostsPage';
import BlogSidebar from '@theme/BlogSidebar';
import Translate from '@docusaurus/Translate';

function pluralize(count: number, word: string) {
return count > 1 ? `${word}s` : word;
Expand All @@ -37,7 +38,13 @@ function BlogTagsPostPage(props: Props): JSX.Element {
{count} {pluralize(count, 'post')} tagged with &quot;{tagName}
&quot;
</h1>
<Link href={allTagsPath}>View All Tags</Link>
<Link href={allTagsPath}>
<Translate
id="theme.tags.tagsPageLink"
description="The label of the link targeting the tag list page">
View All Tags
</Translate>
</Link>
<div className="margin-vert--xl">
{items.map(({content: BlogPostContent}) => (
<BlogPostItem
Expand Down