Internationalization: Mark up more of Dashboard Variables and Browse/Search Dashboards (#63518)

* Extract dirty translations from main

* Translate some variable phrases

* Translate nav bar

* Translate search/browse

* Fix header returning null

* Translate search results type

* fix test
This commit is contained in:
Josh Hunt
2023-02-23 10:46:07 +00:00
committed by GitHub
parent 0abbfbcc59
commit 54aaaf169f
19 changed files with 422 additions and 47 deletions
@@ -29,7 +29,7 @@ describe('AdHocFilter', () => {
await selectEvent.select(selectEl, 'key3', { container: document.body });
// Select value
await userEvent.click(screen.getByText('select value'));
await userEvent.click(screen.getByText('Select value'));
// There are already some filters rendered
const selectEl2 = screen.getAllByTestId('AdHocFilterValue-value-wrapper')[2];
await selectEvent.select(selectEl2, 'val3', { container: document.body });
@@ -1,6 +1,7 @@
import React, { FC, useCallback, useState } from 'react';
import { DataSourceRef, SelectableValue } from '@grafana/data';
import { t } from 'app/core/internationalization';
import { AdHocVariableFilter } from 'app/features/variables/types';
import { AdHocFilterKey, REMOVE_FILTER_KEY } from './AdHocFilterKey';
@@ -64,7 +65,7 @@ export const AdHocFilterBuilder: FC<Props> = ({ datasource, appendBefore, onComp
<AdHocFilterRenderer
datasource={datasource}
filter={{ key, value: '', operator, condition: '' }}
placeHolder="select value"
placeHolder={t('variable.adhoc.placeholder', 'Select value')}
onKeyChange={onKeyChanged}
onOperatorChange={onOperatorChanged}
onValueChange={onValueChanged}
@@ -43,7 +43,7 @@ export class VariableInput extends PureComponent<Props> {
value={value ?? ''}
onChange={this.onChange}
onKeyDown={this.onKeyDown}
placeholder={t('variable.picker.input', 'Enter variable value')}
placeholder={t('variable.dropdown.placeholder', 'Enter variable value')}
/>
);
}
@@ -1,6 +1,7 @@
import React, { ChangeEvent, FocusEvent, KeyboardEvent, ReactElement, useCallback, useEffect, useState } from 'react';
import { Input } from '@grafana/ui';
import { t } from 'app/core/internationalization';
import { useDispatch } from 'app/types';
import { variableAdapters } from '../adapters';
@@ -70,7 +71,7 @@ export function TextBoxVariablePicker({ variable, onVariableChange, readOnly }:
onBlur={onBlur}
disabled={readOnly}
onKeyDown={onKeyDown}
placeholder="Enter variable value"
placeholder={t('variable.textbox.placeholder', 'Enter variable value')}
id={`var-${variable.id}`}
/>
);