From 0a12ad0084e6fc79253709a7afbb76c312380e7c Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Wed, 17 Apr 2024 13:47:01 +0100 Subject: [PATCH] I18n: Update English phrases that have changed in code, but not extracted (#86429) Update English phrases that have changed in code, but not extracted --- package.json | 2 +- .../app/core/internationalization/index.tsx | 2 +- public/locales/en-US/grafana.json | 30 +++++++++---------- public/locales/i18next-parser.config.cjs | 14 +++++++++ public/locales/i18next-parser.config.js | 16 ---------- public/locales/pseudo-LOCALE/grafana.json | 30 +++++++++---------- 6 files changed, 46 insertions(+), 48 deletions(-) create mode 100644 public/locales/i18next-parser.config.cjs delete mode 100644 public/locales/i18next-parser.config.js diff --git a/package.json b/package.json index ee2b5e12b0a..62d3c850f60 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "watch": "yarn start -d watch,start core:start --watchTheme", "ci:test-frontend": "yarn run test:ci", "i18n:clean": "rimraf public/locales/en-US/grafana.json", - "i18n:extract": "yarn run i18next -c public/locales/i18next-parser.config.js 'public/**/*.{tsx,ts}' 'packages/grafana-ui/**/*.{tsx,ts}' && yarn i18n:pseudo", + "i18n:extract": "yarn run i18next -c public/locales/i18next-parser.config.cjs 'public/**/*.{tsx,ts}' 'packages/grafana-ui/**/*.{tsx,ts}' && yarn i18n:pseudo", "i18n:pseudo": "node ./public/locales/pseudo.js", "i18n:stats": "node ./scripts/cli/reportI18nStats.mjs", "betterer": "betterer", diff --git a/public/app/core/internationalization/index.tsx b/public/app/core/internationalization/index.tsx index 98b7c30370a..4d3e4bf047d 100644 --- a/public/app/core/internationalization/index.tsx +++ b/public/app/core/internationalization/index.tsx @@ -11,7 +11,7 @@ let tFunc: TFunction | undefined; export function initializeI18n(language: string): Promise<{ language: string | undefined }> { // 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. Even though it is in a comment the following line is still extracted - // t('_comment', 'This file is the source of truth for English strings. Edit this to change plurals and other phrases for the UI.'); + // t('_comment', 'The code is the source of truth for English phrases. They should be updated in the components directly, and additional plurals specified in this file.'); const options: InitOptions = { // We don't bundle any translations, we load them async diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 3374530e214..35105781c9c 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -1,5 +1,5 @@ { - "_comment": "This file is the source of truth for English strings. Edit this in the codebase to change plurals and other phrases for the UI.", + "_comment": "The code is the source of truth for English phrases. They should be updated in the components directly, and additional plurals specified in this file.", "access-control": { "add-permission": { "role-label": "Role", @@ -36,7 +36,7 @@ "browse-dashboards": { "action": { "cancel-button": "Cancel", - "cannot-move-folders": "Folders can not be moved", + "cannot-move-folders": "Folders cannot be moved", "delete-button": "Delete", "delete-modal-invalid-text": "One or more folders contain library panels or alert rules. Delete these first in order to proceed.", "delete-modal-invalid-title": "Cannot delete folder", @@ -250,14 +250,14 @@ "empty": { "add-library-panel-body": "Add visualizations that are shared with other dashboards.", "add-library-panel-button": "Add library panel", - "add-library-panel-header": "Add a library panel", + "add-library-panel-header": "Import panel", "add-visualization-body": "Select a data source and then query and visualize your data with charts, stats and tables or create lists, markdowns and other widgets.", "add-visualization-button": "Add visualization", "add-visualization-header": "Start your new dashboard by adding a visualization", "add-widget-body": "Create lists, markdowns and other widgets", "add-widget-button": "Add widget", "add-widget-header": "Add a widget", - "import-a-dashboard-body": "Import dashboard from file or <1>grafana.com.", + "import-a-dashboard-body": "Import dashboards from files or<1>grafana.com.", "import-a-dashboard-header": "Import a dashboard", "import-dashboard-button": "Import dashboard" }, @@ -361,7 +361,7 @@ }, "dashboard-delete-button": "Delete Dashboard", "general": { - "auto-refresh-description": "Define the auto refresh intervals that should be available in the auto refresh list.", + "auto-refresh-description": "Define the auto refresh intervals that should be available in the auto refresh list. Use the format '5s' for seconds, '1m' for minutes, '1h' for hours, and '1d' for days (e.g.: '5s,10s,30s,1m,5m,15m,30m,1h,2h,1d').", "auto-refresh-label": "Auto refresh", "description-label": "Description", "editable-description": "Set to read-only to disable all editing. Reload the dashboard for changes to take effect", @@ -550,15 +550,15 @@ "toolbar": { "aria-label": "Explore toolbar", "copy-link": "Copy URL", - "copy-link-abs-time": "Copy absolute URL", + "copy-link-abs-time": "Copy Absolute Shortened URL", "copy-links-absolute-category": "Time-sync URL links (share with time range intact)", "copy-links-normal-category": "Normal URL links", "copy-shortened-link": "Copy shortened URL", - "copy-shortened-link-abs-time": "Copy absolute shortened URL", - "copy-shortened-link-menu": "Open shortened link menu", + "copy-shortened-link-abs-time": "Copy Absolute Shortened URL", + "copy-shortened-link-menu": "Open copy link options", "refresh-picker-cancel": "Cancel", "refresh-picker-run": "Run query", - "split-close": "Close", + "split-close": " Close ", "split-close-tooltip": "Close split pane", "split-narrow": "Narrow pane", "split-title": "Split", @@ -597,9 +597,9 @@ "help-modal": { "shortcuts-category": { "dashboard": "Dashboard", - "focused-panel": "Focused Panel", + "focused-panel": "Focused panel", "global": "Global", - "time-range": "Time Range" + "time-range": "Time range" }, "shortcuts-description": { "change-theme": "Change theme", @@ -666,7 +666,7 @@ "modal": { "body_one": "This panel is being used in {{count}} dashboard. Please choose which dashboard to view the panel in:", "body_other": "This panel is being used in {{count}} dashboards. Please choose which dashboard to view the panel in:", - "button-cancel": "<0>Cancel", + "button-cancel": "Cancel", "button-view-panel1": "View panel in {{label}}...", "button-view-panel2": "View panel in dashboard...", "panel-not-linked": "Panel is not linked to a dashboard. Add the panel to a dashboard and retry.", @@ -933,7 +933,7 @@ "title": "Create" }, "create-alert": { - "title": "Create alert rule" + "title": "New alert rule" }, "create-dashboard": { "title": "Dashboard" @@ -1021,7 +1021,7 @@ "title": "Migrate to Grafana Cloud" }, "monitoring": { - "subtitle": "Monitoring and infrastructure apps", + "subtitle": "Out-of-the-box observability solutions", "title": "Observability" }, "new": { @@ -1477,7 +1477,7 @@ "info-text": "Create a direct link to this dashboard or panel, customized with the options below.", "link-url": "Link URL", "render-alert": "Image renderer plugin not installed", - "render-instructions": "To render a panel image, you must install the <1>Grafana image renderer plugin. Please contact your Grafana administrator to install the plugin.", + "render-instructions": "To render a panel image, you must install the<1>Grafana image renderer plugin. Please contact your Grafana administrator to install the plugin.", "rendered-image": "Direct link rendered image", "save-alert": "Dashboard is not saved", "save-dashboard": "To render a panel image, you must save the dashboard first.", diff --git a/public/locales/i18next-parser.config.cjs b/public/locales/i18next-parser.config.cjs new file mode 100644 index 00000000000..2aeca9d3745 --- /dev/null +++ b/public/locales/i18next-parser.config.cjs @@ -0,0 +1,14 @@ +module.exports = { + // Base config + locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages + sort: true, + createOldCatalogs: false, + failOnWarnings: true, + verbose: false, + resetDefaultValueLocale: 'en-US', // Updates extracted values when they change in code + + // OSS-specific config + defaultNamespace: 'grafana', + input: ['../../public/**/*.{tsx,ts}', '!../../public/app/extensions/**/*', '../../packages/grafana-ui/**/*.{tsx,ts}'], + output: './public/locales/$LOCALE/$NAMESPACE.json', +}; diff --git a/public/locales/i18next-parser.config.js b/public/locales/i18next-parser.config.js deleted file mode 100644 index c83f5e0ce74..00000000000 --- a/public/locales/i18next-parser.config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - // Default namespace used in your i18next config - defaultNamespace: 'grafana', - // Adds changes only to en-US when extracting keys, every other language is provided by Crowdin - locales: ['en-US'], - - output: './public/locales/$LOCALE/$NAMESPACE.json', - - sort: true, - - createOldCatalogs: false, - - failOnWarnings: true, - - verbose: false, -}; diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 118acb01e10..f4b986ac938 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -1,5 +1,5 @@ { - "_comment": "Ŧĥįş ƒįľę įş ŧĥę şőūřčę őƒ ŧřūŧĥ ƒőř Ēʼnģľįşĥ şŧřįʼnģş. Ēđįŧ ŧĥįş įʼn ŧĥę čőđęþäşę ŧő čĥäʼnģę pľūřäľş äʼnđ őŧĥęř pĥřäşęş ƒőř ŧĥę ŮĨ.", + "_comment": "Ŧĥę čőđę įş ŧĥę şőūřčę őƒ ŧřūŧĥ ƒőř Ēʼnģľįşĥ pĥřäşęş. Ŧĥęy şĥőūľđ þę ūpđäŧęđ įʼn ŧĥę čőmpőʼnęʼnŧş đįřęčŧľy, äʼnđ äđđįŧįőʼnäľ pľūřäľş şpęčįƒįęđ įʼn ŧĥįş ƒįľę.", "access-control": { "add-permission": { "role-label": "Ŗőľę", @@ -36,7 +36,7 @@ "browse-dashboards": { "action": { "cancel-button": "Cäʼnčęľ", - "cannot-move-folders": "Főľđęřş čäʼn ʼnőŧ þę mővęđ", + "cannot-move-folders": "Főľđęřş čäʼnʼnőŧ þę mővęđ", "delete-button": "Đęľęŧę", "delete-modal-invalid-text": "Øʼnę őř mőřę ƒőľđęřş čőʼnŧäįʼn ľįþřäřy päʼnęľş őř äľęřŧ řūľęş. Đęľęŧę ŧĥęşę ƒįřşŧ įʼn őřđęř ŧő přőčęęđ.", "delete-modal-invalid-title": "Cäʼnʼnőŧ đęľęŧę ƒőľđęř", @@ -250,14 +250,14 @@ "empty": { "add-library-panel-body": "Åđđ vįşūäľįžäŧįőʼnş ŧĥäŧ äřę şĥäřęđ ŵįŧĥ őŧĥęř đäşĥþőäřđş.", "add-library-panel-button": "Åđđ ľįþřäřy päʼnęľ", - "add-library-panel-header": "Åđđ ä ľįþřäřy päʼnęľ", + "add-library-panel-header": "Ĩmpőřŧ päʼnęľ", "add-visualization-body": "Ŝęľęčŧ ä đäŧä şőūřčę äʼnđ ŧĥęʼn qūęřy äʼnđ vįşūäľįžę yőūř đäŧä ŵįŧĥ čĥäřŧş, şŧäŧş äʼnđ ŧäþľęş őř čřęäŧę ľįşŧş, mäřĸđőŵʼnş äʼnđ őŧĥęř ŵįđģęŧş.", "add-visualization-button": "Åđđ vįşūäľįžäŧįőʼn", "add-visualization-header": "Ŝŧäřŧ yőūř ʼnęŵ đäşĥþőäřđ þy äđđįʼnģ ä vįşūäľįžäŧįőʼn", "add-widget-body": "Cřęäŧę ľįşŧş, mäřĸđőŵʼnş äʼnđ őŧĥęř ŵįđģęŧş", "add-widget-button": "Åđđ ŵįđģęŧ", "add-widget-header": "Åđđ ä ŵįđģęŧ", - "import-a-dashboard-body": "Ĩmpőřŧ đäşĥþőäřđ ƒřőm ƒįľę őř <1>ģřäƒäʼnä.čőm.", + "import-a-dashboard-body": "Ĩmpőřŧ đäşĥþőäřđş ƒřőm ƒįľęş őř<1>ģřäƒäʼnä.čőm.", "import-a-dashboard-header": "Ĩmpőřŧ ä đäşĥþőäřđ", "import-dashboard-button": "Ĩmpőřŧ đäşĥþőäřđ" }, @@ -361,7 +361,7 @@ }, "dashboard-delete-button": "Đęľęŧę Đäşĥþőäřđ", "general": { - "auto-refresh-description": "Đęƒįʼnę ŧĥę äūŧő řęƒřęşĥ įʼnŧęřväľş ŧĥäŧ şĥőūľđ þę äväįľäþľę įʼn ŧĥę äūŧő řęƒřęşĥ ľįşŧ.", + "auto-refresh-description": "Đęƒįʼnę ŧĥę äūŧő řęƒřęşĥ įʼnŧęřväľş ŧĥäŧ şĥőūľđ þę äväįľäþľę įʼn ŧĥę äūŧő řęƒřęşĥ ľįşŧ. Ůşę ŧĥę ƒőřmäŧ '5ş' ƒőř şęčőʼnđş, '1m' ƒőř mįʼnūŧęş, '1ĥ' ƒőř ĥőūřş, äʼnđ '1đ' ƒőř đäyş (ę.ģ.: '5ş,10ş,30ş,1m,5m,15m,30m,1ĥ,2ĥ,1đ').", "auto-refresh-label": "Åūŧő řęƒřęşĥ", "description-label": "Đęşčřįpŧįőʼn", "editable-description": "Ŝęŧ ŧő řęäđ-őʼnľy ŧő đįşäþľę äľľ ęđįŧįʼnģ. Ŗęľőäđ ŧĥę đäşĥþőäřđ ƒőř čĥäʼnģęş ŧő ŧäĸę ęƒƒęčŧ", @@ -550,15 +550,15 @@ "toolbar": { "aria-label": "Ēχpľőřę ŧőőľþäř", "copy-link": "Cőpy ŮŖĿ", - "copy-link-abs-time": "Cőpy äþşőľūŧę ŮŖĿ", + "copy-link-abs-time": "Cőpy Åþşőľūŧę Ŝĥőřŧęʼnęđ ŮŖĿ", "copy-links-absolute-category": "Ŧįmę-şyʼnč ŮŖĿ ľįʼnĸş (şĥäřę ŵįŧĥ ŧįmę řäʼnģę įʼnŧäčŧ)", "copy-links-normal-category": "Ńőřmäľ ŮŖĿ ľįʼnĸş", "copy-shortened-link": "Cőpy şĥőřŧęʼnęđ ŮŖĿ", - "copy-shortened-link-abs-time": "Cőpy äþşőľūŧę şĥőřŧęʼnęđ ŮŖĿ", - "copy-shortened-link-menu": "Øpęʼn şĥőřŧęʼnęđ ľįʼnĸ męʼnū", + "copy-shortened-link-abs-time": "Cőpy Åþşőľūŧę Ŝĥőřŧęʼnęđ ŮŖĿ", + "copy-shortened-link-menu": "Øpęʼn čőpy ľįʼnĸ őpŧįőʼnş", "refresh-picker-cancel": "Cäʼnčęľ", "refresh-picker-run": "Ŗūʼn qūęřy", - "split-close": "Cľőşę", + "split-close": " Cľőşę ", "split-close-tooltip": "Cľőşę şpľįŧ päʼnę", "split-narrow": "Ńäřřőŵ päʼnę", "split-title": "Ŝpľįŧ", @@ -597,9 +597,9 @@ "help-modal": { "shortcuts-category": { "dashboard": "Đäşĥþőäřđ", - "focused-panel": "Főčūşęđ Päʼnęľ", + "focused-panel": "Főčūşęđ päʼnęľ", "global": "Ğľőþäľ", - "time-range": "Ŧįmę Ŗäʼnģę" + "time-range": "Ŧįmę řäʼnģę" }, "shortcuts-description": { "change-theme": "Cĥäʼnģę ŧĥęmę", @@ -666,7 +666,7 @@ "modal": { "body_one": "Ŧĥįş päʼnęľ įş þęįʼnģ ūşęđ įʼn {{count}} đäşĥþőäřđ. Pľęäşę čĥőőşę ŵĥįčĥ đäşĥþőäřđ ŧő vįęŵ ŧĥę päʼnęľ įʼn:", "body_other": "Ŧĥįş päʼnęľ įş þęįʼnģ ūşęđ įʼn {{count}} đäşĥþőäřđş. Pľęäşę čĥőőşę ŵĥįčĥ đäşĥþőäřđ ŧő vįęŵ ŧĥę päʼnęľ įʼn:", - "button-cancel": "<0>Cäʼnčęľ", + "button-cancel": "Cäʼnčęľ", "button-view-panel1": "Vįęŵ päʼnęľ įʼn {{label}}...", "button-view-panel2": "Vįęŵ päʼnęľ įʼn đäşĥþőäřđ...", "panel-not-linked": "Päʼnęľ įş ʼnőŧ ľįʼnĸęđ ŧő ä đäşĥþőäřđ. Åđđ ŧĥę päʼnęľ ŧő ä đäşĥþőäřđ äʼnđ řęŧřy.", @@ -933,7 +933,7 @@ "title": "Cřęäŧę" }, "create-alert": { - "title": "Cřęäŧę äľęřŧ řūľę" + "title": "Ńęŵ äľęřŧ řūľę" }, "create-dashboard": { "title": "Đäşĥþőäřđ" @@ -1021,7 +1021,7 @@ "title": "Mįģřäŧę ŧő Ğřäƒäʼnä Cľőūđ" }, "monitoring": { - "subtitle": "Mőʼnįŧőřįʼnģ äʼnđ įʼnƒřäşŧřūčŧūřę äppş", + "subtitle": "Øūŧ-őƒ-ŧĥę-þőχ őþşęřväþįľįŧy şőľūŧįőʼnş", "title": "Øþşęřväþįľįŧy" }, "new": { @@ -1477,7 +1477,7 @@ "info-text": "Cřęäŧę ä đįřęčŧ ľįʼnĸ ŧő ŧĥįş đäşĥþőäřđ őř päʼnęľ, čūşŧőmįžęđ ŵįŧĥ ŧĥę őpŧįőʼnş þęľőŵ.", "link-url": "Ŀįʼnĸ ŮŖĿ", "render-alert": "Ĩmäģę řęʼnđęřęř pľūģįʼn ʼnőŧ įʼnşŧäľľęđ", - "render-instructions": "Ŧő řęʼnđęř ä päʼnęľ įmäģę, yőū mūşŧ įʼnşŧäľľ ŧĥę <1>Ğřäƒäʼnä įmäģę řęʼnđęřęř pľūģįʼn. Pľęäşę čőʼnŧäčŧ yőūř Ğřäƒäʼnä äđmįʼnįşŧřäŧőř ŧő įʼnşŧäľľ ŧĥę pľūģįʼn.", + "render-instructions": "Ŧő řęʼnđęř ä päʼnęľ įmäģę, yőū mūşŧ įʼnşŧäľľ ŧĥę<1>Ğřäƒäʼnä įmäģę řęʼnđęřęř pľūģįʼn. Pľęäşę čőʼnŧäčŧ yőūř Ğřäƒäʼnä äđmįʼnįşŧřäŧőř ŧő įʼnşŧäľľ ŧĥę pľūģįʼn.", "rendered-image": "Đįřęčŧ ľįʼnĸ řęʼnđęřęđ įmäģę", "save-alert": "Đäşĥþőäřđ įş ʼnőŧ şävęđ", "save-dashboard": "Ŧő řęʼnđęř ä päʼnęľ įmäģę, yőū mūşŧ şävę ŧĥę đäşĥþőäřđ ƒįřşŧ.",