Skip to content

Commit

Permalink
feat: Add translation
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbiscuit committed Mar 1, 2023
1 parent 619efd2 commit 3b71a86
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
17 changes: 17 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language: en\n"
"Language-Team: \n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: widget/IconSelectorWidget
# defaultMessage: Search...
msgid "Search..."
msgstr ""
32 changes: 32 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of plone.pot to French
# French Translation Team <plone-i18n@lists.sourceforge.net>, 2003-2006.
# Sebastien Douche <sdouche@gmail.com>, 2005-2007.
# Encolpe Degoute <encolpe.degoute@ingeniweb.com>, 2006, 2007, 2008.
# Gilles Lenfant <gilles.lenfant@ingeniweb.com>, 2008.
# Encolpe Degoute <encolpe@gmail.com>, 2008.
# Vincent Fretin <vincent.fretin@gmail.com>, 2009.
# Kevin Deldycke <kevin@deldycke.com>, 2009.
# JeanMichel FRANCOIS <toutpt@gmail.com>, 2010.
# Denis Bitouzé <denis.bitouze@univ-littoral.fr>, 2019.
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-27T19:30:59.079Z\n"
"PO-Revision-Date: 2016-10-22 16:41-0500\n"
"Last-Translator: Benoît Suttor <benoit.suttor@imio.be>\n"
"Language: fr\n"
"Language-Team: French <plone-fr@lists.plone.org>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Language-Code: fr\n"
"Language-Name: French\n"
"Preferred-Encodings: utf-8 latin1\n"
"X-Is-Fallback-For: fr-be fr-ca fr-lu fr-mc fr-ch fr-fr\n"

#: widget/IconSelectorWidget
# defaultMessage: Search...
msgid "Search..."
msgstr "Rechercher ..."
7 changes: 6 additions & 1 deletion locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2021-01-29T12:34:47.097Z\n"
"POT-Creation-Date: 2023-03-01T09:07:18.024Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand All @@ -12,3 +12,8 @@ msgstr ""
"Language-Name: English\n"
"Preferred-Encodings: utf-8\n"
"Domain: volto\n"

#: widget/IconSelectorWidget
# defaultMessage: Search...
msgid "Search..."
msgstr ""
11 changes: 10 additions & 1 deletion src/widget/IconSelectorWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import _ from 'lodash';
import React, { useState } from 'react';
import { FormFieldWrapper } from '@plone/volto/components';
import { Search, Icon } from 'semantic-ui-react';
import { useIntl, defineMessages } from 'react-intl';
import config from '@plone/volto/registry';
import '../styles/style.less';

const messages = defineMessages({
placeholder: {
id: 'Search...',
defaultMessage: 'Search...',
},
});

const initialState = {
loading: false,
results: {},
Expand All @@ -28,12 +36,13 @@ function reducer(state, action) {
}

const IconSelectorWidget = (props) => {
const intl = useIntl();
const {
id,
value: blockValue,
onChange,
onBlur,
placeholder = 'Search...',
placeholder = intl.formatMessage(messages.placeholder),
} = props;

const inputId = `field-${id}`;
Expand Down

0 comments on commit 3b71a86

Please sign in to comment.