I18n: Mark up phrases for translation on NewFolder drawer (#70888)

* I18n:Mark up phrases for translation on NewFolder drawer

* Updated variable name from field-label to name-label
This commit is contained in:
RoxanaAnamariaTurc 2023-06-30 12:13:03 +01:00 committed by GitHub
parent af9b071a78
commit e2dd1e9055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import React from 'react';
import { Button, Input, Form, Field, HorizontalGroup } from '@grafana/ui';
import { Trans, t } from 'app/core/internationalization';
import { validationSrv } from '../../manage-dashboards/services/ValidationSrv';
@ -29,12 +30,14 @@ export function NewFolderForm({ onCancel, onConfirm }: Props) {
}
};
const fieldNameLabel = t('browse-dashboards.new-folder-form.name-label', 'Folder name');
return (
<Form defaultValues={initialFormModel} onSubmit={(form: FormModel) => onConfirm(form.folderName)}>
{({ register, errors }) => (
<>
<Field
label="Folder name"
label={fieldNameLabel}
invalid={!!errors.folderName}
error={errors.folderName && errors.folderName.message}
>
@ -48,9 +51,11 @@ export function NewFolderForm({ onCancel, onConfirm }: Props) {
</Field>
<HorizontalGroup>
<Button variant="secondary" fill="outline" onClick={onCancel}>
Cancel
<Trans i18nKey="browse-dashboards.new-folder-form.cancel-label">Cancel</Trans>
</Button>
<Button type="submit">
<Trans i18nKey="browse-dashboards.new-folder-form.create-label">Create</Trans>
</Button>
<Button type="submit">Create</Button>
</HorizontalGroup>
</>
)}

View File

@ -38,6 +38,11 @@
"manage-permissions": "",
"move": ""
},
"new-folder-form": {
"cancel-label": "",
"create-label": "",
"name-label": ""
},
"no-results": {
"clear": "",
"text": ""

View File

@ -38,6 +38,11 @@
"manage-permissions": "Manage permissions",
"move": "Move"
},
"new-folder-form": {
"cancel-label": "Cancel",
"create-label": "Create",
"name-label": "Folder name"
},
"no-results": {
"clear": "Clear search and filters",
"text": "No results found for your query."

View File

@ -38,6 +38,11 @@
"manage-permissions": "",
"move": ""
},
"new-folder-form": {
"cancel-label": "",
"create-label": "",
"name-label": ""
},
"no-results": {
"clear": "",
"text": ""

View File

@ -38,6 +38,11 @@
"manage-permissions": "",
"move": ""
},
"new-folder-form": {
"cancel-label": "",
"create-label": "",
"name-label": ""
},
"no-results": {
"clear": "",
"text": ""

View File

@ -38,6 +38,11 @@
"manage-permissions": "Mäʼnäģę pęřmįşşįőʼnş",
"move": "Mővę"
},
"new-folder-form": {
"cancel-label": "Cäʼnčęľ",
"create-label": "Cřęäŧę",
"name-label": "Főľđęř ʼnämę"
},
"no-results": {
"clear": "Cľęäř şęäřčĥ äʼnđ ƒįľŧęřş",
"text": "Ńő řęşūľŧş ƒőūʼnđ ƒőř yőūř qūęřy."

View File

@ -38,6 +38,11 @@
"manage-permissions": "",
"move": ""
},
"new-folder-form": {
"cancel-label": "",
"create-label": "",
"name-label": ""
},
"no-results": {
"clear": "",
"text": ""