Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ describe('Localization', () => {
cy.visit('/dashboards?pseudolocalization=true&lng=en');
masthead.clickMastheadLink('help-dropdown-toggle');
// wait for both console help menu items and additionalHelpActions items to load
// additionalHelpActions come from ConsoleLinks 'HelpMenu' yaml and are not translated
// only test console help items which are translated
cy.get('.pf-c-app-launcher__group')
.first()
.within(() => {
cy.get('[role="menuitem"]').isPseudoLocalized();
});
cy.get('.pf-c-app-launcher__group').should('have.length', 2);
// Test that all links are translated
cy.get('.pf-c-app-launcher__group [role="menuitem"]').isPseudoLocalized();
});

it('pseudolocalizes navigation', () => {
Expand Down
23 changes: 23 additions & 0 deletions frontend/public/components/masthead-toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ import { ConsoleLinkModel } from '../models';
import { languagePreferencesModal } from './modals';
import { withTelemetry, withQuickStartContext } from '@console/shared/src/hoc';

const defaultHelpLinks = [
{
// t('public~Learning Portal')
label: 'Learning Portal',
externalLink: true,
href: 'https://learn.openshift.com/?ref=webconsole',
},
{
// t('public~OpenShift Blog')
label: 'OpenShift Blog',
externalLink: true,
href: 'https://blog.openshift.com',
},
];

const SystemStatusButton = ({ statuspageData, className }) => {
const { t } = useTranslation();
return !_.isEmpty(_.get(statuspageData, 'incidents')) ? (
Expand Down Expand Up @@ -378,6 +393,14 @@ class MastheadToolbarContents_ extends React.Component {
],
});

// Add default help links to start of additional links from operator
additionalHelpActions.actions = defaultHelpLinks
.map((helpLink) => ({
...helpLink,
label: t(`public~${helpLink.label}`),
}))
.concat(additionalHelpActions.actions);

if (!_.isEmpty(additionalHelpActions.actions)) {
helpActions.push(additionalHelpActions);
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@
"Instance type": "Instance type",
"Machine addresses": "Machine addresses",
"by machine or node name": "by machine or node name",
"Learning Portal": "Learning Portal",
"OpenShift Blog": "OpenShift Blog",
"System status": "System status",
"Red Hat applications": "Red Hat applications",
"Quick Starts": "Quick Starts",
Expand Down