diff --git a/packages/grafana-ui/src/utils/i18n.tsx b/packages/grafana-ui/src/utils/i18n.tsx index a721e5066ee..f6777c6bad6 100644 --- a/packages/grafana-ui/src/utils/i18n.tsx +++ b/packages/grafana-ui/src/utils/i18n.tsx @@ -28,7 +28,11 @@ export const Trans: typeof I18NextTrans = (props) => { return ; }; +// Reassign t() so i18next-parser doesn't warn on dynamic key, and we can have 'failOnWarnings' enabled +const tFunc = i18next.t; + export const t = (id: string, defaultMessage: string, values?: Record) => { initI18n(); - return i18next.t(id, defaultMessage, values); + + return tFunc(id, defaultMessage, values); }; diff --git a/public/app/core/internationalization/index.tsx b/public/app/core/internationalization/index.tsx index ffdfe5ff56c..fa9c0d2988c 100644 --- a/public/app/core/internationalization/index.tsx +++ b/public/app/core/internationalization/index.tsx @@ -55,8 +55,11 @@ export const Trans: typeof I18NextTrans = (props) => { return ; }; +// Reassign t() so i18next-parser doesn't warn on dynamic key, and we can have 'failOnWarnings' enabled +const tFunc = i18n.t; + export const t = (id: string, defaultMessage: string, values?: Record) => { - return i18n.t(id, defaultMessage, values); + return tFunc(id, defaultMessage, values); }; export const i18nDate = (value: number | Date | string, format: Intl.DateTimeFormatOptions = {}): string => { diff --git a/public/app/features/dashboard/containers/NewDashboardPage.tsx b/public/app/features/dashboard/containers/NewDashboardPage.tsx index 934728a73e9..368b98abeb3 100644 --- a/public/app/features/dashboard/containers/NewDashboardPage.tsx +++ b/public/app/features/dashboard/containers/NewDashboardPage.tsx @@ -32,7 +32,7 @@ export default function NewDashboardPage(props: GrafanaRouteComponentProps) { title={t('datasource-onboarding.welcome', 'Welcome to Grafana dashboards!')} CTAText={t('datasource-onboarding.sampleData', 'Or set up a new dashboard with sample data')} navId="dashboards/browse" - pageNav={{ text: t('dashboard', 'New dashboard'), url: '/dashboard/new' }} + pageNav={{ text: t('datasource-onboarding.new-dashboard', 'New dashboard'), url: '/dashboard/new' }} /> ); } diff --git a/public/locales/de-DE/grafana.json b/public/locales/de-DE/grafana.json index a23038c88d7..64ee1b2dfb9 100644 --- a/public/locales/de-DE/grafana.json +++ b/public/locales/de-DE/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "Markierung als Favorit entfernen" } }, + "datasource-onboarding": { + "contact-admin": "", + "explanation": "", + "logo": "", + "new-dashboard": "", + "preferred": "", + "sampleData": "", + "viewAll": "", + "welcome": "" + }, "folder-picker": { "loading": "Ordner werden geladen …" }, @@ -131,6 +141,9 @@ "subtitle": "Zeige gruppierte Warnungen vom Alertmanager an", "title": "Gruppen" }, + "alerting-home": { + "title": "" + }, "alerting-legacy": { "title": "Warnungen (Legacy)" }, @@ -208,6 +221,7 @@ "help/documentation": "Dokumentation", "help/keyboard-shortcuts": "Tastaturbefehle", "help/support": "Support", + "help/support-bundle": "", "home": { "title": "Home" }, @@ -298,6 +312,10 @@ "subtitle": "Dateispeicher verwalten", "title": "Speicher" }, + "support-bundles": { + "subtitle": "", + "title": "" + }, "teams": { "subtitle": "Gruppen von Benutzern mit gemeinsamen Dashboards und Benachrichtigungen", "title": "Teams" diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index a5d68e18d78..51e16eb3bff 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "Unmark as favorite" } }, + "datasource-onboarding": { + "contact-admin": "Please contact your administrator to configure data sources.", + "explanation": "To visualize your data, you'll need to connect it first.", + "logo": "Logo for {{datasourceName}} data source", + "new-dashboard": "New dashboard", + "preferred": "Connect your preferred data source:", + "sampleData": "Or set up a new dashboard with sample data", + "viewAll": "View all", + "welcome": "Welcome to Grafana dashboards!" + }, "folder-picker": { "loading": "Loading folders..." }, @@ -131,6 +141,9 @@ "subtitle": "See grouped alerts from an Alertmanager instance", "title": "Groups" }, + "alerting-home": { + "title": "Home" + }, "alerting-legacy": { "title": "Alerting (legacy)" }, @@ -208,6 +221,7 @@ "help/documentation": "Documentation", "help/keyboard-shortcuts": "Keyboard shortcuts", "help/support": "Support", + "help/support-bundle": "Support Bundles", "home": { "title": "Home" }, @@ -298,6 +312,10 @@ "subtitle": "Manage file storage", "title": "Storage" }, + "support-bundles": { + "subtitle": "Download support bundles", + "title": "Support Bundles" + }, "teams": { "subtitle": "Groups of users that have common dashboard and permission needs", "title": "Teams" diff --git a/public/locales/es-ES/grafana.json b/public/locales/es-ES/grafana.json index cc0c38101b0..d46ff4edd4c 100644 --- a/public/locales/es-ES/grafana.json +++ b/public/locales/es-ES/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "Deshacer marca como favorito" } }, + "datasource-onboarding": { + "contact-admin": "", + "explanation": "", + "logo": "", + "new-dashboard": "", + "preferred": "", + "sampleData": "", + "viewAll": "", + "welcome": "" + }, "folder-picker": { "loading": "Cargando carpetas..." }, @@ -131,6 +141,9 @@ "subtitle": "Ver alertas agrupadas de una instancia de Alertmanager", "title": "Grupos" }, + "alerting-home": { + "title": "" + }, "alerting-legacy": { "title": "Alertas (heredado)" }, @@ -208,6 +221,7 @@ "help/documentation": "Documentación", "help/keyboard-shortcuts": "Atajos de teclado", "help/support": "Asistencia", + "help/support-bundle": "", "home": { "title": "Inicio" }, @@ -298,6 +312,10 @@ "subtitle": "Gestionar el almacenamiento de archivos", "title": "Almacenamiento" }, + "support-bundles": { + "subtitle": "", + "title": "" + }, "teams": { "subtitle": "Grupos de usuarios que tienen necesidades comunes de permisos y de panel de control", "title": "Equipos" diff --git a/public/locales/fr-FR/grafana.json b/public/locales/fr-FR/grafana.json index e2f9e752b9c..4661d5cfb68 100644 --- a/public/locales/fr-FR/grafana.json +++ b/public/locales/fr-FR/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "Supprimer des favoris" } }, + "datasource-onboarding": { + "contact-admin": "", + "explanation": "", + "logo": "", + "new-dashboard": "", + "preferred": "", + "sampleData": "", + "viewAll": "", + "welcome": "" + }, "folder-picker": { "loading": "Chargement des dossiers..." }, @@ -131,6 +141,9 @@ "subtitle": "Consulter les alertes groupées d'une instance Alertmanager", "title": "Groupes" }, + "alerting-home": { + "title": "" + }, "alerting-legacy": { "title": "Alerte (existante)" }, @@ -208,6 +221,7 @@ "help/documentation": "Documentation", "help/keyboard-shortcuts": "Raccourcis clavier", "help/support": "Assistance", + "help/support-bundle": "", "home": { "title": "Accueil" }, @@ -298,6 +312,10 @@ "subtitle": "Gérer le stockage de fichiers", "title": "Stockage" }, + "support-bundles": { + "subtitle": "", + "title": "" + }, "teams": { "subtitle": "Groupes d'utilisateurs ayant des besoins communs en matière de tableau de bord et d'autorisations", "title": "Équipes" diff --git a/public/locales/i18next-parser.config.js b/public/locales/i18next-parser.config.js index 8c608d8b129..9c30a722ccc 100644 --- a/public/locales/i18next-parser.config.js +++ b/public/locales/i18next-parser.config.js @@ -12,6 +12,10 @@ module.exports = { createOldCatalogs: false, + failOnWarnings: true, + + verbose: false, + // Don't include default values for English, they'll remain in the source code skipDefaultValues: (locale) => locale !== 'en-US', }; diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 14a3869cc61..f93ff178e03 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "Ůʼnmäřĸ äş ƒävőřįŧę" } }, + "datasource-onboarding": { + "contact-admin": "Pľęäşę čőʼnŧäčŧ yőūř äđmįʼnįşŧřäŧőř ŧő čőʼnƒįģūřę đäŧä şőūřčęş.", + "explanation": "Ŧő vįşūäľįžę yőūř đäŧä, yőū'ľľ ʼnęęđ ŧő čőʼnʼnęčŧ įŧ ƒįřşŧ.", + "logo": "Ŀőģő ƒőř {{datasourceName}} đäŧä şőūřčę", + "new-dashboard": "Ńęŵ đäşĥþőäřđ", + "preferred": "Cőʼnʼnęčŧ yőūř přęƒęřřęđ đäŧä şőūřčę:", + "sampleData": "Øř şęŧ ūp ä ʼnęŵ đäşĥþőäřđ ŵįŧĥ şämpľę đäŧä", + "viewAll": "Vįęŵ äľľ", + "welcome": "Ŵęľčőmę ŧő Ğřäƒäʼnä đäşĥþőäřđş!" + }, "folder-picker": { "loading": "Ŀőäđįʼnģ ƒőľđęřş..." }, @@ -131,6 +141,9 @@ "subtitle": "Ŝęę ģřőūpęđ äľęřŧş ƒřőm äʼn Åľęřŧmäʼnäģęř įʼnşŧäʼnčę", "title": "Ğřőūpş" }, + "alerting-home": { + "title": "Ħőmę" + }, "alerting-legacy": { "title": "Åľęřŧįʼnģ (ľęģäčy)" }, @@ -208,6 +221,7 @@ "help/documentation": "Đőčūmęʼnŧäŧįőʼn", "help/keyboard-shortcuts": "Ķęyþőäřđ şĥőřŧčūŧş", "help/support": "Ŝūppőřŧ", + "help/support-bundle": "Ŝūppőřŧ ßūʼnđľęş", "home": { "title": "Ħőmę" }, @@ -298,6 +312,10 @@ "subtitle": "Mäʼnäģę ƒįľę şŧőřäģę", "title": "Ŝŧőřäģę" }, + "support-bundles": { + "subtitle": "Đőŵʼnľőäđ şūppőřŧ þūʼnđľęş", + "title": "Ŝūppőřŧ ßūʼnđľęş" + }, "teams": { "subtitle": "Ğřőūpş őƒ ūşęřş ŧĥäŧ ĥävę čőmmőʼn đäşĥþőäřđ äʼnđ pęřmįşşįőʼn ʼnęęđş", "title": "Ŧęämş" diff --git a/public/locales/zh-Hans/grafana.json b/public/locales/zh-Hans/grafana.json index 33a19117b7a..a9746d6e3b1 100644 --- a/public/locales/zh-Hans/grafana.json +++ b/public/locales/zh-Hans/grafana.json @@ -80,6 +80,16 @@ "unmark-favorite": "取消标记为收藏" } }, + "datasource-onboarding": { + "contact-admin": "", + "explanation": "", + "logo": "", + "new-dashboard": "", + "preferred": "", + "sampleData": "", + "viewAll": "", + "welcome": "" + }, "folder-picker": { "loading": "正在加载文件夹..." }, @@ -131,6 +141,9 @@ "subtitle": "查看来自 Alertmanager(警报管理器)实例的分组警报", "title": "组" }, + "alerting-home": { + "title": "" + }, "alerting-legacy": { "title": "警报(遗留)" }, @@ -208,6 +221,7 @@ "help/documentation": "文档", "help/keyboard-shortcuts": "快捷键", "help/support": "支持", + "help/support-bundle": "", "home": { "title": "首页" }, @@ -298,6 +312,10 @@ "subtitle": "管理文件存储", "title": "存储" }, + "support-bundles": { + "subtitle": "", + "title": "" + }, "teams": { "subtitle": "具有共同仪表板和权限需求的用户组", "title": "团队"