-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v2): fix bad theme pluralization rules for some labels (#4304)
* Pluralization test! * Simplify usePluralForm usage with | plural message separator * fix interpolate bug with falsy values like 0 * fix interpolate bug with falsy values like 0 * Order plural forms + allow to not provide the last plural forms if they are not used * fix typo * revert test! * plurals and typo of the SearchPage * update some labels * improve the update-code-translations cli + update translations * pluralize blog reading time label * ensure base.json contains message descriptions: helps the user to provide the translations * remove russian production locale
- Loading branch information
Showing
16 changed files
with
358 additions
and
75 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/docusaurus-theme-classic/codeTranslations/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Default theme translations | ||
|
||
The Docusaurus theme includes default translations for labels used by the theme itself (like the pagination "Next" / "Previous"). | ||
|
||
## For Docusaurus users: | ||
|
||
Please help us provide exhaustive translations: | ||
|
||
- add your `language.json` file if it is missing (copy `base.json` and remove the attributes `___DESCRIPTION`) | ||
- double-check your `language.json` file for bad or missing translations | ||
|
||
## For maintainers: | ||
|
||
After updating the theme code, you can "synchronize" the translations by running: | ||
|
||
``` | ||
yarn workspace @docusaurus/theme-classic update-code-translations | ||
``` | ||
|
||
Then, ask contributors to translate the newly added labels on this [issue](https://github.com/facebook/docusaurus/issues/3526) |
74 changes: 70 additions & 4 deletions
74
packages/docusaurus-theme-classic/codeTranslations/base.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,134 @@ | ||
{ | ||
"theme.AnnouncementBar.closeButtonAriaLabel": "Close", | ||
"theme.AnnouncementBar.closeButtonAriaLabel___DESCRIPTION": "The ARIA label for close button of announcement bar", | ||
"theme.CodeBlock.copied": "Copied", | ||
"theme.CodeBlock.copied___DESCRIPTION": "The copied button label on code blocks", | ||
"theme.CodeBlock.copy": "Copy", | ||
"theme.CodeBlock.copyButtonAriaLabel": "Copy code to clipboard", | ||
"theme.CodeBlock.copyButtonAriaLabel___DESCRIPTION": "The ARIA label for copy code blocks button", | ||
"theme.CodeBlock.copy___DESCRIPTION": "The copy button label on code blocks", | ||
"theme.NotFound.p1": "We could not find what you were looking for.", | ||
"theme.NotFound.p1___DESCRIPTION": "The first paragraph of the 404 page", | ||
"theme.NotFound.p2": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.", | ||
"theme.NotFound.p2___DESCRIPTION": "The 2nd paragraph of the 404 page", | ||
"theme.NotFound.title": "Page Not Found", | ||
"theme.NotFound.title___DESCRIPTION": "The title of the 404 page", | ||
"theme.Playground.liveEditor": "Live Editor", | ||
"theme.Playground.liveEditor___DESCRIPTION": "The live editor label of the live codeblocks", | ||
"theme.Playground.result": "Result", | ||
"theme.Playground.result___DESCRIPTION": "The result label of the live codeblocks", | ||
"theme.PwaReloadPopup.closeButtonAriaLabel": "Close", | ||
"theme.PwaReloadPopup.closeButtonAriaLabel___DESCRIPTION": "The ARIA label for close button of PWA reload popup", | ||
"theme.PwaReloadPopup.info": "New version available", | ||
"theme.PwaReloadPopup.info___DESCRIPTION": "The text for PWA reload popup", | ||
"theme.PwaReloadPopup.refreshButtonText": "Refresh", | ||
"theme.PwaReloadPopup.refreshButtonText___DESCRIPTION": "The text for PWA reload button", | ||
"theme.SearchBar.label": "Search", | ||
"theme.SearchBar.label___DESCRIPTION": "The ARIA label and placeholder for search button", | ||
"theme.SearchPage.algoliaLabel": "Search by Algolia", | ||
"theme.SearchPage.algoliaLabel___DESCRIPTION": "The ARIA label for Algolia mention", | ||
"theme.SearchPage.documentsFound.plurals": "One document found|{count} documents found", | ||
"theme.SearchPage.documentsFound.plurals___DESCRIPTION": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)", | ||
"theme.SearchPage.emptyResultsTitle": "Search the documentation", | ||
"theme.SearchPage.emptyResultsTitle___DESCRIPTION": "The search page title for empty query", | ||
"theme.SearchPage.existingResultsTitle": "Search results for \"{query}\"", | ||
"theme.SearchPage.existingResultsTitle___DESCRIPTION": "The search page title for non-empty query", | ||
"theme.SearchPage.fetchingNewResults": "Fetching new results...", | ||
"theme.SearchPage.fetchingNewResults___DESCRIPTION": "The paragraph for fetching new search results", | ||
"theme.SearchPage.inputLabel": "Search", | ||
"theme.SearchPage.inputLabel___DESCRIPTION": "The ARIA label for search page input", | ||
"theme.SearchPage.inputPlaceholder": "Type your search here", | ||
"theme.SearchPage.inputPlaceholder___DESCRIPTION": "The placeholder for search page input", | ||
"theme.SearchPage.noResultsText": "No results were found", | ||
"theme.SearchPage.noResultsText___DESCRIPTION": "The paragraph for empty search result", | ||
"theme.blog.paginator.navAriaLabel": "Blog list page navigation", | ||
"theme.blog.paginator.navAriaLabel___DESCRIPTION": "The ARIA label for the blog pagination", | ||
"theme.blog.paginator.newerEntries": "Newer Entries", | ||
"theme.blog.paginator.newerEntries___DESCRIPTION": "The label used to navigate to the newer blog posts page (previous page)", | ||
"theme.blog.paginator.olderEntries": "Older Entries", | ||
"theme.blog.paginator.olderEntries___DESCRIPTION": "The label used to navigate to the older blog posts page (next page)", | ||
"theme.blog.post.date": "{month} {day}, {year}", | ||
"theme.blog.post.nPosts": "{count} posts", | ||
"theme.blog.post.onePost": "One post", | ||
"theme.blog.post.date___DESCRIPTION": "The label to display the blog post date", | ||
"theme.blog.post.paginator.navAriaLabel": "Blog post page navigation", | ||
"theme.blog.post.paginator.navAriaLabel___DESCRIPTION": "The ARIA label for the blog posts pagination", | ||
"theme.blog.post.paginator.newerPost": "Newer Post", | ||
"theme.blog.post.paginator.newerPost___DESCRIPTION": "The blog post button label to navigate to the newer/previous post", | ||
"theme.blog.post.paginator.olderPost": "Older Post", | ||
"theme.blog.post.paginator.olderPost___DESCRIPTION": "The blog post button label to navigate to the older/next post", | ||
"theme.blog.post.plurals": "One post|{count} posts", | ||
"theme.blog.post.plurals___DESCRIPTION": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)", | ||
"theme.blog.post.readMore": "Read More", | ||
"theme.blog.post.readingTime": "{readingTime} min read", | ||
"theme.blog.post.readMore___DESCRIPTION": "The label used in blog post item excerpts to link to full blog posts", | ||
"theme.blog.post.readingTime.plurals": "One min read|{readingTime} min read", | ||
"theme.blog.post.readingTime.plurals___DESCRIPTION": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)", | ||
"theme.blog.tagTitle": "{nPosts} tagged with \"{tagName}\"", | ||
"theme.blog.tagTitle___DESCRIPTION": "The title of the page for a blog tag", | ||
"theme.common.editThisPage": "Edit this page", | ||
"theme.common.editThisPage___DESCRIPTION": "The link label to edit the current page", | ||
"theme.common.headingLinkTitle": "Direct link to heading", | ||
"theme.common.headingLinkTitle___DESCRIPTION": "Title for link to heading", | ||
"theme.common.month.april": "April", | ||
"theme.common.month.april___DESCRIPTION": "April month translation", | ||
"theme.common.month.august": "August", | ||
"theme.common.month.august___DESCRIPTION": "August month translation", | ||
"theme.common.month.december": "December", | ||
"theme.common.month.december___DESCRIPTION": "December month translation", | ||
"theme.common.month.february": "February", | ||
"theme.common.month.february___DESCRIPTION": "February month translation", | ||
"theme.common.month.january": "January", | ||
"theme.common.month.january___DESCRIPTION": "January month translation", | ||
"theme.common.month.july": "July", | ||
"theme.common.month.july___DESCRIPTION": "July month translation", | ||
"theme.common.month.june": "June", | ||
"theme.common.month.june___DESCRIPTION": "June month translation", | ||
"theme.common.month.march": "March", | ||
"theme.common.month.march___DESCRIPTION": "March month translation", | ||
"theme.common.month.may": "May", | ||
"theme.common.month.may___DESCRIPTION": "May month translation", | ||
"theme.common.month.november": "November", | ||
"theme.common.month.november___DESCRIPTION": "November month translation", | ||
"theme.common.month.october": "October", | ||
"theme.common.month.october___DESCRIPTION": "October month translation", | ||
"theme.common.month.september": "September", | ||
"theme.common.month.september___DESCRIPTION": "September month translation", | ||
"theme.common.skipToMainContent": "Skip to main content", | ||
"theme.common.skipToMainContent___DESCRIPTION": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation", | ||
"theme.docs.paginator.navAriaLabel": "Docs pages navigation", | ||
"theme.docs.paginator.navAriaLabel___DESCRIPTION": "The ARIA label for the docs pagination", | ||
"theme.docs.paginator.next": "Next", | ||
"theme.docs.paginator.next___DESCRIPTION": "The label used to navigate to the next doc", | ||
"theme.docs.paginator.previous": "Previous", | ||
"theme.docs.paginator.previous___DESCRIPTION": "The label used to navigate to the previous doc", | ||
"theme.docs.sidebar.collapseButtonAriaLabel": "Collapse sidebar", | ||
"theme.docs.sidebar.collapseButtonAriaLabel___DESCRIPTION": "The title attribute for collapse button of doc sidebar", | ||
"theme.docs.sidebar.collapseButtonTitle": "Collapse sidebar", | ||
"theme.docs.sidebar.collapseButtonTitle___DESCRIPTION": "The title attribute for collapse button of doc sidebar", | ||
"theme.docs.sidebar.expandButtonAriaLabel": "Expand sidebar", | ||
"theme.docs.sidebar.expandButtonAriaLabel___DESCRIPTION": "The ARIA label and title attribute for expand button of doc sidebar", | ||
"theme.docs.sidebar.expandButtonTitle": "Expand sidebar", | ||
"theme.docs.sidebar.expandButtonTitle___DESCRIPTION": "The ARIA label and title attribute for expand button of doc sidebar", | ||
"theme.docs.sidebar.responsiveCloseButtonLabel": "Close menu", | ||
"theme.docs.sidebar.responsiveCloseButtonLabel___DESCRIPTION": "The ARIA label for close button of mobile doc sidebar", | ||
"theme.docs.sidebar.responsiveOpenButtonLabel": "Open menu", | ||
"theme.docs.sidebar.responsiveOpenButtonLabel___DESCRIPTION": "The ARIA label for open button of mobile doc sidebar", | ||
"theme.docs.versions.latestVersionLinkLabel": "latest version", | ||
"theme.docs.versions.latestVersionLinkLabel___DESCRIPTION": "The label used for the latest version suggestion link label", | ||
"theme.docs.versions.latestVersionSuggestionLabel": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", | ||
"theme.docs.versions.latestVersionSuggestionLabel___DESCRIPTION": "The label userd to tell the user that he's browsing an unmaintained doc version", | ||
"theme.docs.versions.unmaintainedVersionLabel": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.", | ||
"theme.docs.versions.unmaintainedVersionLabel___DESCRIPTION": "The label used to tell the user that he's browsing an unmaintained doc version", | ||
"theme.docs.versions.unreleasedVersionLabel": "This is unreleased documentation for {siteTitle} {versionLabel} version.", | ||
"theme.docs.versions.unreleasedVersionLabel___DESCRIPTION": "The label used to tell the user that he's browsing an unreleased doc version", | ||
"theme.lastUpdated.atDate": " on {date}", | ||
"theme.lastUpdated.atDate___DESCRIPTION": "The words used to describe on which date a page has been last updated", | ||
"theme.lastUpdated.byUser": " by {user}", | ||
"theme.lastUpdated.byUser___DESCRIPTION": "The words used to describe by who the page has been last updated", | ||
"theme.lastUpdated.lastUpdatedAtBy": "Last updated{atDate}{byUser}", | ||
"theme.lastUpdated.lastUpdatedAtBy___DESCRIPTION": "The sentence used to display when a page has been last updated, and by who", | ||
"theme.tags.tagsListLabel": "Tags:", | ||
"theme.tags.tagsListLabel___DESCRIPTION": "The label alongside a tag list", | ||
"theme.tags.tagsPageLink": "View All Tags", | ||
"theme.tags.tagsPageTitle": "Tags" | ||
"theme.tags.tagsPageLink___DESCRIPTION": "The label of the link targeting the tag list page", | ||
"theme.tags.tagsPageTitle": "Tags", | ||
"theme.tags.tagsPageTitle___DESCRIPTION": "The title of the tag list page" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.