Explorar el Código

OCPBUGS-65887: Update i18n strings

logonoff hace 10 meses
padre
commit
28f21004e0

+ 1 - 1
console-extensions.json

@@ -11,7 +11,7 @@
     "type": "console.navigation/href",
     "properties": {
       "id": "example",
-      "name": "%plugin__console-plugin-template~Plugin Example%",
+      "name": "%plugin__console-plugin-template~Plugin example%",
       "href": "/example",
       "perspective": "admin",
       "section": "home"

+ 2 - 2
integration-tests/tests/example-page.cy.ts

@@ -66,8 +66,8 @@ describe('Console plugin template test', () => {
 
   it('Verify the example page title', () => {
     cy.get('[data-quickstart-id="qs-nav-home"]').click();
-    cy.get('[data-test="nav"]').contains('Plugin Example').click();
+    cy.get('[data-test="nav"]').contains('Plugin example').click();
     cy.url().should('include', '/example');
-    cy.get('title').should('contain', 'Hello, Plugin!');
+    cy.get('title').should('contain', 'Hello, plugin!');
   });
 });

+ 5 - 9
locales/en/plugin__console-plugin-template.json

@@ -1,12 +1,8 @@
 {
-  "After cloning this project, replace references to": "After cloning this project, replace references to",
-  "and other plugin metadata in package.json with values for your plugin.": "and other plugin metadata in package.json with values for your plugin.",
-  "console-template-plugin": "console-template-plugin",
-  "exposedModules": "exposedModules",
-  "Hello, Plugin!": "Hello, Plugin!",
-  "in package.json mapping the reference to the module.": "in package.json mapping the reference to the module.",
-  "Plugin Example": "Plugin Example",
+  "After cloning this project, replace references to <1>console-template-plugin</1> and other plugin metadata in package.json with values for your plugin.": "After cloning this project, replace references to <1>console-template-plugin</1> and other plugin metadata in package.json with values for your plugin.",
+  "Hello, plugin!": "Hello, plugin!",
+  "Plugin example": "Plugin example",
   "Success!": "Success!",
-  "This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property": "This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property",
+  "This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property <2>exposedModules</2> in package.json mapping the reference to the module.": "This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property <2>exposedModules</2> in package.json mapping the reference to the module.",
   "Your plugin is working.": "Your plugin is working."
-}
+}

+ 14 - 11
src/components/ExamplePage.tsx

@@ -1,5 +1,5 @@
 import { DocumentTitle, ListPageHeader } from '@openshift-console/dynamic-plugin-sdk';
-import { useTranslation } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
 import { Content, PageSection } from '@patternfly/react-core';
 import { CheckCircleIcon } from '@patternfly/react-icons';
 import './example.css';
@@ -9,8 +9,8 @@ export default function ExamplePage() {
 
   return (
     <>
-      <DocumentTitle>{t('Hello, Plugin!')}</DocumentTitle>
-      <ListPageHeader title={t('Hello, Plugin!')} />
+      <DocumentTitle>{t('Hello, plugin!')}</DocumentTitle>
+      <ListPageHeader title={t('Hello, plugin!')} />
       <PageSection>
         <Content component="p">
           <span className="console-plugin-template__nice">
@@ -19,16 +19,19 @@ export default function ExamplePage() {
           {t('Your plugin is working.')}
         </Content>
         <Content component="p">
-          {t(
-            'This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property',
-          )}
-          <code>{t('exposedModules')}</code>{' '}
-          {t('in package.json mapping the reference to the module.')}
+          <Trans t={t}>
+            This is a custom page contributed by the console plugin template. The extension that
+            adds the page is declared in console-extensions.json in the project root along with the
+            corresponding nav item. Update console-extensions.json to change or add extensions. Code
+            references in console-extensions.json must have a corresponding property{' '}
+            <code>exposedModules</code> in package.json mapping the reference to the module.
+          </Trans>
         </Content>
         <Content component="p">
-          {t('After cloning this project, replace references to')}{' '}
-          <code>{t('console-template-plugin')}</code>{' '}
-          {t('and other plugin metadata in package.json with values for your plugin.')}
+          <Trans t={t}>
+            After cloning this project, replace references to <code>console-template-plugin</code>{' '}
+            and other plugin metadata in package.json with values for your plugin.
+          </Trans>
         </Content>
       </PageSection>
     </>