Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-32480

Dynamic plugin can break the i18n feature of the console

XMLWordPrintable

    • No
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Sometimes, console dynamic plugins may utilize the i18n object in a variable outside of a React component to force the i18n parser to generate the translation label. Since the console i18n object is not exported, developers can initialize their own i18next variable:
      
      import i18next from 'i18next';
      import { initReactI18next } from 'react-i18next';
      
      i18next.init({});
      
      export const i18n = i18next; 
      
      The issue arises when the configuration of this i18n object is incorrect, potentially breaking the console i18n feature, which should be avoided. Specifically, the issue occurs if the i18n plugin object is passed down to the react-i18next library like so:
      
      i18next
        .use(initReactI18next) // passes i18n down to react-i18next.
        .init({});

      Version-Release number of selected component (if applicable):

      OpenShift Console 4.15

      How reproducible:

      When a dynamic plugin is installed with own i18n settings

      Steps to Reproduce:

          1. Run dynamic plugin with own 18n settings in the console
          2. Verify that all i18n labels of the console are not translated correctly 

      Actual results:

      A dynamic plugin can break the console i18n feature if it initializes its own i18n incorrectly.

      Expected results:

      A dynamic plugin should not interfere on the console i18n feature

              vszocs@redhat.com Vojtech Szocs
              rh-ee-fhoyosle Fernando Hoyos Leyva
              Sanket Pathak Sanket Pathak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: