Skip to content

Commit

Permalink
Backport i18n polishing (#5542) and update locales (#5695)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikel Larreategi <mlarreategi@codesyntax.com>
Co-authored-by: David Glick <david@glicksoftware.com>
  • Loading branch information
3 people authored Jan 25, 2024
1 parent 01eeebc commit 0db505d
Show file tree
Hide file tree
Showing 22 changed files with 13,972 additions and 14,028 deletions.
1,863 changes: 930 additions & 933 deletions locales/ca/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,861 changes: 930 additions & 931 deletions locales/de/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,860 changes: 930 additions & 930 deletions locales/en/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,868 changes: 932 additions & 936 deletions locales/es/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,860 changes: 930 additions & 930 deletions locales/eu/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,866 changes: 930 additions & 936 deletions locales/fi/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,870 changes: 930 additions & 940 deletions locales/fr/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,860 changes: 930 additions & 930 deletions locales/it/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,863 changes: 930 additions & 933 deletions locales/ja/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,875 changes: 930 additions & 945 deletions locales/nl/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,863 changes: 930 additions & 933 deletions locales/pt/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,864 changes: 930 additions & 934 deletions locales/pt_BR/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,860 changes: 930 additions & 930 deletions locales/ro/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

1,868 changes: 932 additions & 936 deletions locales/volto.pot

Large diffs are not rendered by default.

1,860 changes: 930 additions & 930 deletions locales/zh_CN/LC_MESSAGES/volto.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"@loadable/component": "5.14.1",
"@loadable/server": "5.14.0",
"@loadable/webpack-plugin": "5.15.2",
"@plone/scripts": "^3.2.1",
"@plone/scripts": "^3.3.1",
"@testing-library/cypress": "9.0.0",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "12.1.5",
Expand Down
11 changes: 5 additions & 6 deletions packages/scripts/i18n.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ function getMessages() {
function messagesToPot(messages) {
return map(keys(messages).sort(), (key) =>
[
`#. Default: "${messages[key].defaultMessage.trim()}"`,
...map(messages[key].filenames, (filename) => `#: ${filename}`),
`# defaultMessage: ${messages[key].defaultMessage}`,
`msgid "${key}"`,
'msgstr ""',
].join('\n'),
Expand All @@ -124,10 +124,10 @@ msgstr ""
"POT-Creation-Date: ${new Date().toISOString()}\\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"
"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: en\\n"
"Language-Name: English\\n"
"Preferred-Encodings: utf-8\\n"
Expand All @@ -153,7 +153,7 @@ function poToJson({ registry, addonMode }) {
language === 'en'
? item.msgstr[0] ||
(item.comments[0]
? item.comments[0].replace('defaultMessage: ', '')
? item.comments[0].replace('. Default: ', '')
: '')
: item.msgstr[0];
}
Expand Down Expand Up @@ -212,7 +212,7 @@ function poToJson({ registry, addonMode }) {
*/
function formatHeader(comments, headers) {
return [
...map(comments, (comment) => `# ${comment}`),
...map(comments, (comment) => `#. ${comment}`),
'msgid ""',
'msgstr ""',
...map(keys(headers), (key) => `"${key}: ${headers[key]}\\n"`),
Expand All @@ -227,7 +227,6 @@ function formatHeader(comments, headers) {
*/
function syncPoByPot() {
const pot = Pofile.parse(fs.readFileSync('locales/volto.pot', 'utf8'));

map(glob('locales/**/*.po'), (filename) => {
const po = Pofile.parse(fs.readFileSync(filename, 'utf8'));

Expand All @@ -237,8 +236,8 @@ function syncPoByPot() {
${map(pot.items, (item) => {
const poItem = find(po.items, { msgid: item.msgid });
return [
`#. ${item.extractedComments[0]}`,
`${map(item.references, (ref) => `#: ${ref}`).join('\n')}`,
`# ${item.comments[0]}`,
`msgid "${item.msgid}"`,
`msgstr "${poItem ? poItem.msgstr : ''}"`,
].join('\n');
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/news/5542.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Polish po file handling @erral
1 change: 1 addition & 0 deletions packages/volto/news/5542.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Polish po file handling @erral
12 changes: 4 additions & 8 deletions src/components/manage/Contents/Contents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1226,10 +1226,8 @@ class Contents extends Component {
this.state.containedItemsToDelete > 0 ? (
<>
<FormattedMessage
id="Some items are also a folder.
By deleting them you will delete {containedItemsToDelete} {variation} inside the folders."
defaultMessage="Some items are also a folder.
By deleting them you will delete {containedItemsToDelete} {variation} inside the folders."
id="Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders."
defaultMessage="Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders."
values={{
containedItemsToDelete: (
<span>
Expand Down Expand Up @@ -1323,10 +1321,8 @@ class Contents extends Component {
) : this.state.containedItemsToDelete > 0 ? (
<>
<FormattedMessage
id="This item is also a folder.
By deleting it you will delete {containedItemsToDelete} {variation} inside the folder."
defaultMessage="This item is also a folder.
By deleting it you will delete {containedItemsToDelete} {variation} inside the folder."
id="This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder."
defaultMessage="This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder."
values={{
containedItemsToDelete: (
<span>
Expand Down
2 changes: 1 addition & 1 deletion src/config/Blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const blocksConfig = {
},
{
id: 'daterangeFacet',
title: 'Date range',
title: 'Date Range',
view: DateRangeFacet,
isDefault: false,
stateToValue: DateRangeFacet.stateToValue,
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3359,9 +3359,9 @@ __metadata:
languageName: node
linkType: hard

"@plone/scripts@npm:^3.2.1":
version: 3.2.1
resolution: "@plone/scripts@npm:3.2.1"
"@plone/scripts@npm:^3.3.1":
version: 3.3.1
resolution: "@plone/scripts@npm:3.3.1"
dependencies:
"@babel/core": ^7.0.0
babel-plugin-react-intl: 5.1.17
Expand All @@ -3379,7 +3379,7 @@ __metadata:
addon: addon/index.js
changelogupdater: changelogupdater.cjs
i18n: i18n.cjs
checksum: e0d2fc60945e545db034724979f20e30d37039f00a86428eb3d0ee256103c6b062e6136520643649be3614816abc4effae063d2a9c84be42e0af03b829bc9b9e
checksum: ca61990664378456f3ea97f3cbd00ed9c805990edc6a3d4d452e6a858ff21297e24bede4706307136506399898fdbb8934f8af55de9848a1adb9235295cda8db
languageName: node
linkType: hard

Expand All @@ -3401,7 +3401,7 @@ __metadata:
"@loadable/component": 5.14.1
"@loadable/server": 5.14.0
"@loadable/webpack-plugin": 5.15.2
"@plone/scripts": ^3.2.1
"@plone/scripts": ^3.3.1
"@storybook/addon-actions": ^6.5.15
"@storybook/addon-controls": 6.5.15
"@storybook/addon-essentials": ^6.5.15
Expand Down

0 comments on commit 0db505d

Please sign in to comment.