Skip to content

Commit

Permalink
Translate versions dropdown label
Browse files Browse the repository at this point in the history
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
  • Loading branch information
Josh-Cena committed Aug 17, 2021
1 parent 7d0272f commit b88f32b
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " بواسطة {user}",
"theme.lastUpdated.lastUpdatedAtBy": "آخر تحديث{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "الوسوم:",
"theme.tags.tagsPageLink": "عرض كل الوسوم",
"theme.tags.tagsPageTitle": "الوسوم"
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-theme-classic/codeTranslations/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
"theme.lastUpdated.lastUpdatedAtBy___DESCRIPTION": "The sentence used to display when a page has been last updated, and by who",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel___DESCRIPTION": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.navbar.mobileVersionsDropdown.label___DESCRIPTION": "The label for the navbar versions dropdown on mobile view",
"theme.tags.tagsListLabel": "Tags:",
"theme.tags.tagsListLabel___DESCRIPTION": "The label alongside a tag list",
"theme.tags.tagsPageLink": "View All Tags",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": "{user} দ্বারা",
"theme.lastUpdated.lastUpdatedAtBy": "সর্বশেষ সংষ্করণ{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← মেন মেনুতে যান",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "ট্যাগ্স:",
"theme.tags.tagsPageLink": "সমস্ত ট্যাগ্স দেখুন",
"theme.tags.tagsPageTitle": "ট্যাগ্স"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " od {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Naposledy aktualizováno{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Zpět na hlavní menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tagy:",
"theme.tags.tagsPageLink": "Zobrazit všechny tagy",
"theme.tags.tagsPageTitle": "Tagy"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " af {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Senest opdateret{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tags:",
"theme.tags.tagsPageLink": "Se alle Tags",
"theme.tags.tagsPageTitle": "Tags"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " von {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Letztes Update{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tags:",
"theme.tags.tagsPageLink": "Alle Tags anzeigen",
"theme.tags.tagsPageTitle": "Tags"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " por {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Última actualización{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Etiquetas:",
"theme.tags.tagsPageLink": "Ver Todas las Etiquetas",
"theme.tags.tagsPageTitle": "Etiquetas"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " توسط {user}",
"theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی در {atDate} توسط {byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "→ بازگشت به منو اصلی",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "برچسب ها:",
"theme.tags.tagsPageLink": "مشاهده تمام برچسب ها",
"theme.tags.tagsPageTitle": "برچسب ها"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " ni {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Huling inapdeyt{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Mga Tag:",
"theme.tags.tagsPageLink": "Tingnan Lahat ng mga Tag",
"theme.tags.tagsPageTitle": "Mga Tag"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " par {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Dernière mise à jour{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Retour au menu principal",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tags :",
"theme.tags.tagsPageLink": "Voir tous les tags",
"theme.tags.tagsPageTitle": "Tags"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " על ידי {user}",
"theme.lastUpdated.lastUpdatedAtBy": "עודכן{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← חזרה לתפריט הראשי",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "תגיות:",
"theme.tags.tagsPageLink": "כל התגיות",
"theme.tags.tagsPageTitle": "תגיות"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " {user} द्वारा",
"theme.lastUpdated.lastUpdatedAtBy": "आखरी अपडेट{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← मुख्य मेनू में वापस जाएं",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "टैग:",
"theme.tags.tagsPageLink": "सारे टैग देखें",
"theme.tags.tagsPageTitle": "टैग"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": "{user}が",
"theme.lastUpdated.lastUpdatedAtBy": "{atDate}{byUser}最終更新",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "タグ:",
"theme.tags.tagsPageLink": "全てのタグを見る",
"theme.tags.tagsPageTitle": "タグ"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " {user}가",
"theme.lastUpdated.lastUpdatedAtBy": "{atDate}{byUser} 마지막으로 업데이트했습니다.",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "태그:",
"theme.tags.tagsPageLink": "모든 태그 보기",
"theme.tags.tagsPageTitle": "태그"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " przez {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Ostatnia aktualizacja{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tagi:",
"theme.tags.tagsPageLink": "Wyświetl wszystkie tagi",
"theme.tags.tagsPageTitle": "Tagi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " por {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Última atualização {atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Marcadores:",
"theme.tags.tagsPageLink": "Ver todas os Marcadores",
"theme.tags.tagsPageTitle": "Marcadores"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " por {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Última atualização{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Tags:",
"theme.tags.tagsPageLink": "Ver todas as Tags",
"theme.tags.tagsPageTitle": "Tags"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " от {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Последнее обновление{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Перейти к главному меню",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Теги:",
"theme.tags.tagsPageLink": "Посмотреть все теги",
"theme.tags.tagsPageTitle": "Теги"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " {user} tarafından",
"theme.lastUpdated.lastUpdatedAtBy": "En son{atDate}{byUser} güncellendi",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Etiketler:",
"theme.tags.tagsPageLink": "Tüm Etiketleri Görüntüle",
"theme.tags.tagsPageTitle": "Etiketler"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/codeTranslations/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": " bởi {user}",
"theme.lastUpdated.lastUpdatedAtBy": "Cập nhật lần cuối{atDate}{byUser}",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← Back to main menu",
"theme.navbar.mobileVersionsDropdown.label": "Versions",
"theme.tags.tagsListLabel": "Thẻ:",
"theme.tags.tagsPageLink": "Xem tất cả Thẻ",
"theme.tags.tagsPageTitle": "Thẻ"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": "由 {user} ",
"theme.lastUpdated.lastUpdatedAtBy": "最后{byUser}{atDate}更新",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← 回到主菜单",
"theme.navbar.mobileVersionsDropdown.label": "选择版本",
"theme.tags.tagsListLabel": "标签:",
"theme.tags.tagsPageLink": "查看所有标签",
"theme.tags.tagsPageTitle": "标签"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"theme.lastUpdated.byUser": "由 {user} ",
"theme.lastUpdated.lastUpdatedAtBy": "最後{byUser}{atDate}更新",
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "← 回到主菜單",
"theme.navbar.mobileVersionsDropdown.label": "選擇版本",
"theme.tags.tagsListLabel": "標籤:",
"theme.tags.tagsPageLink": "查看所有標籤",
"theme.tags.tagsPageTitle": "標籤"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@theme/hooks/useDocs';
import type {Props} from '@theme/NavbarItem/DocsVersionDropdownNavbarItem';
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
import {translate} from '@docusaurus/Translate';

const getVersionMainDoc = (version) =>
version.docs.find((doc) => doc.id === version.mainDocId);
Expand Down Expand Up @@ -62,7 +63,15 @@ export default function DocsVersionDropdownNavbarItem({
activeDocContext.activeVersion ?? preferredVersion ?? latestVersion;

// Mobile dropdown is handled a bit differently
const dropdownLabel = mobile && items ? 'Versions' : dropdownVersion.label;
const dropdownLabel =
mobile && items
? translate({
id: 'theme.navbar.mobileVersionsDropdown.label',
message: 'Versions',
description:
'The label for the navbar versions dropdown on mobile view',
})
: dropdownVersion.label;
const dropdownTo =
mobile && items ? undefined : getVersionMainDoc(dropdownVersion).path;

Expand Down

0 comments on commit b88f32b

Please sign in to comment.