Skip to content

Commit 2440a07

Browse files
committed
fix placeholder i18n
1 parent cfb6b34 commit 2440a07

File tree

15 files changed

+23
-3
lines changed

15 files changed

+23
-3
lines changed

geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_widgets/TextWidgetMultiLang.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ import isString from 'lodash/isString';
1212

1313
import DefaultTextareaWidget from '@rjsf/core/lib/components/widgets/TextareaWidget';
1414
import IconWithTooltip from '../IconWithTooltip';
15+
import Message from '@mapstore/framework/components/I18N/Message';
16+
import { getMessageById } from '@mapstore/framework/utils/LocaleUtils';
1517

1618
const TextWidgetMultiLang = (props) => {
1719

1820
const { formData, onChange, schema, required, formContext } = props;
21+
console.log('TextWidgetMultiLang props', props);
22+
1923
const id = props.id || Math.random().toString(36).substring(7);
2024
const { title, description } = schema;
2125

@@ -45,6 +49,8 @@ const TextWidgetMultiLang = (props) => {
4549
onChange(newValue);
4650
};
4751

52+
const placeholder = getMessageById(formContext.messages, "gnviewer.typeText").replace("{lang}", languageLong(currentLang));
53+
4854
return (
4955
<div className="form-group field field-string multilang-widget">
5056
<label className={`control-label${formContext?.capitalizeTitle ? ' capitalize' : ''}`}>
@@ -62,7 +68,7 @@ const TextWidgetMultiLang = (props) => {
6268
onFocus={() => {}}
6369
onBlur={() => {}}
6470
options={{ rows: 5 }}
65-
placeholder={`Type textarea in ${languageLong(currentLang)}...`}
71+
placeholder={placeholder}
6672
/>
6773
) :
6874
<input
@@ -71,7 +77,7 @@ const TextWidgetMultiLang = (props) => {
7177
value={values[currentLang] || ""}
7278
onChange={handleInputChange}
7379
onBlur={() => {}}
74-
placeholder={`Type text in ${languageLong(currentLang)}...`}
80+
placeholder={placeholder}
7581
/>
7682
}
7783

geonode_mapstore_client/client/js/plugins/MetadataEditor/containers/MetadataEditor.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ function MetadataEditor({
236236
formContext={{
237237
title: formTitle,
238238
metadata: metadataMultiLang,
239-
capitalizeTitle: capitalizeFieldTitle
239+
capitalizeTitle: capitalizeFieldTitle,
240+
messages
240241
}}
241242
schema={schemaMultiLang}
242243
uiSchema={uiSchemaMultiLang}

geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@
504504
"datasetTitle": "Datensatztitel",
505505
"name": "Name",
506506
"type": "Typ",
507+
"typeText": "Text in {lang} eingeben...",
507508
"nillable": "Nullbar",
508509
"restrictions": "Einschränkungen",
509510
"loadAttributesFromJSONSchema": "Attribute aus JSON-Schema laden",

geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@
504504
"datasetTitle": "Dataset title",
505505
"name": "Name",
506506
"type": "Type",
507+
"typeText": "Type text in {lang} ...",
507508
"nillable": "Nillable",
508509
"restrictions": "Restrictions",
509510
"loadAttributesFromJSONSchema": "Load attributes from JSON Schema",

geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@
503503
"datasetTitle": "Título del conjunto de datos",
504504
"name": "Nombre",
505505
"type": "Tipo",
506+
"typeText": "Escriba texto en {lang} ...",
506507
"nillable": "Nulable",
507508
"restrictions": "Restricciones",
508509
"loadAttributesFromJSONSchema": "Cargar atributos desde esquema JSON",

geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@
474474
"datasetTitle": "Dataset title",
475475
"name": "Name",
476476
"type": "Type",
477+
"typeText": "Kirjoita teksti kielellä {lang} ...",
477478
"nillable": "Nillable",
478479
"restrictions": "Restrictions",
479480
"loadAttributesFromJSONSchema": "Load attributes from JSON Schema",

geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@
504504
"datasetTitle": "Titre du jeu de données",
505505
"name": "Nom",
506506
"type": "Type",
507+
"typeText": "Tapez le texte en {lang} ...",
507508
"nillable": "Nullable",
508509
"restrictions": "Restrictions",
509510
"loadAttributesFromJSONSchema": "Charger les attributs depuis le schéma JSON",

geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@
474474
"datasetTitle": "Dataset title",
475475
"name": "Name",
476476
"type": "Type",
477+
"typeText": "Unesite tekst na {lang} ...",
477478
"nillable": "Nillable",
478479
"restrictions": "Restrictions",
479480
"loadAttributesFromJSONSchema": "Load attributes from JSON Schema",

geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@
506506
"datasetTitle": "Titolo del dataset",
507507
"name": "Nome",
508508
"type": "Tipo",
509+
"typeText": "Digita il testo in {lang} ...",
509510
"nillable": "Annullabile",
510511
"restrictions": "Restrizioni",
511512
"loadAttributesFromJSONSchema": "Carica attributi da schema JSON",

geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@
474474
"datasetTitle": "Dataset title",
475475
"name": "Name",
476476
"type": "Type",
477+
"typeText": "Typ tekst in {lang} ...",
477478
"nillable": "Nillable",
478479
"restrictions": "Restrictions",
479480
"loadAttributesFromJSONSchema": "Load attributes from JSON Schema",

0 commit comments

Comments
 (0)