Navigation: Ensure command palette is correctly translated (#61103)

* Navigation: Translate nav tree in store

* Remove usage of getNavTitle

* properly translate children

* add pubdash translation

* remove extraneous calls to translation in PageHeader

* empty commit

* correctly allow subtitle to be overrwitten (thank you tests!)

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Josh Hunt
2023-02-08 13:15:37 +00:00
committed by GitHub
parent bc67edbff8
commit 504eabbe80
23 changed files with 108 additions and 74 deletions

View File

@@ -22,7 +22,14 @@ const loadTranslations: BackendModule = {
export function initializeI18n(language: string) {
const validLocale = VALID_LANGUAGES.includes(language) ? language : DEFAULT_LANGUAGE;
i18n
// This is a placeholder so we can put a 'comment' in the message json files.
// Starts with an underscore so it's sorted to the top of the file
t(
'_comment',
'Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source'
);
return i18n
.use(loadTranslations)
.use(initReactI18next) // passes i18n down to react-i18next
.init({
@@ -37,13 +44,6 @@ export function initializeI18n(language: string) {
pluralSeparator: '__',
});
// This is a placeholder so we can put a 'comment' in the message json files.
// Starts with an underscore so it's sorted to the top of the file
t(
'_comment',
'Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source'
);
}
export function changeLanguage(locale: string) {