Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

EZP-26444 / EZP-26660 Make strings in JavaScript code translatable #713

Merged
merged 3 commits into from Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions DependencyInjection/EzPlatformUIExtension.php
Expand Up @@ -81,9 +81,9 @@ private function prependImageVariations(ContainerBuilder $container)
public function getTranslationDomains()
{
return [
'bar', 'confirm', 'contentedit', 'contenttypeselector', 'dashboardblocks', 'editorial',
'bar', 'confirm', 'contentedit', 'contenttypeselector', 'dashboardblocks',
'fieldedit', 'fieldview', 'languageselection', 'locationview', 'login', 'navigationhub',
'search', 'subitem', 'trash', 'tree', 'universaldiscovery',
'search', 'subitem', 'trash', 'tree', 'universaldiscovery', 'onlineeditor', 'section', 'role',
];
}
}
108 changes: 61 additions & 47 deletions Resources/config/yui.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/blockremove.js
Expand Up @@ -51,7 +51,7 @@ YUI.add('ez-alloyeditor-button-blockremove', function (Y) {
return {
command: 'eZRemoveBlock',
modifiesSelection: true,
label: 'Remove this block',
label: Y.eZ.trans('remove.this.block', {}, 'onlineeditor'),
};
},

Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/blockremove.jsx
Expand Up @@ -46,7 +46,7 @@ YUI.add('ez-alloyeditor-button-blockremove', function (Y) {
return {
command: 'eZRemoveBlock',
modifiesSelection: true,
label: 'Remove this block',
label: Y.eZ.trans('remove.this.block', {}, 'onlineeditor'),
};
},

Expand Down
Expand Up @@ -40,7 +40,7 @@ YUI.add('ez-alloyeditor-button-blocktextaligncenter', function (Y) {
return {
textAlign: 'center',
classIcon: 'center',
label: 'Center',
label: Y.eZ.trans('center', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -35,7 +35,7 @@ YUI.add('ez-alloyeditor-button-blocktextaligncenter', function (Y) {
return {
textAlign: 'center',
classIcon: 'center',
label: 'Center',
label: Y.eZ.trans('center', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -40,7 +40,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignjustify', function (Y) {
return {
textAlign: 'justify',
classIcon: 'justified',
label: 'Justify',
label: Y.eZ.trans('justify', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -35,7 +35,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignjustify', function (Y) {
return {
textAlign: 'justify',
classIcon: 'justified',
label: 'Justify',
label: Y.eZ.trans('justify', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -40,7 +40,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignleft', function (Y) {
return {
textAlign: 'left',
classIcon: 'left',
label: 'Left',
label: Y.eZ.trans('left', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -35,7 +35,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignleft', function (Y) {
return {
textAlign: 'left',
classIcon: 'left',
label: 'Left',
label: Y.eZ.trans('left', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -40,7 +40,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignright', function (Y) {
return {
textAlign: 'right',
classIcon: 'right',
label: 'Right',
label: Y.eZ.trans('right', {}, 'onlineeditor'),
};
},
});
Expand Down
Expand Up @@ -35,7 +35,7 @@ YUI.add('ez-alloyeditor-button-blocktextalignright', function (Y) {
return {
textAlign: 'right',
classIcon: 'right',
label: 'Right',
label: Y.eZ.trans('right', {}, 'onlineeditor'),
};
},
});
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/embed.js
Expand Up @@ -39,7 +39,7 @@ YUI.add('ez-alloyeditor-button-embed', function (Y) {
return {
command: 'ezembed',
modifiesSelection: true,
udwTitle: "Select a content to embed",
udwTitle: Y.eZ.trans('select.a.content.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: '_addEmbed',
};
},
Expand Down Expand Up @@ -69,7 +69,7 @@ YUI.add('ez-alloyeditor-button-embed', function (Y) {
return (
React.createElement("button", {className: css, onClick: this._chooseContent, tabIndex: this.props.tabIndex},
React.createElement("span", {className: "ez-ae-icon ez-ae-icon-embed ez-font-icon"}),
React.createElement("p", {className: "ez-ae-label"}, "Embed")
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('embed', {}, 'onlineeditor'))
)
);
},
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/embed.jsx
Expand Up @@ -34,7 +34,7 @@ YUI.add('ez-alloyeditor-button-embed', function (Y) {
return {
command: 'ezembed',
modifiesSelection: true,
udwTitle: "Select a content to embed",
udwTitle: Y.eZ.trans('select.a.content.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: '_addEmbed',
};
},
Expand Down Expand Up @@ -64,7 +64,7 @@ YUI.add('ez-alloyeditor-button-embed', function (Y) {
return (
<button className={css} onClick={this._chooseContent} tabIndex={this.props.tabIndex}>
<span className="ez-ae-icon ez-ae-icon-embed ez-font-icon"></span>
<p className="ez-ae-label">Embed</p>
<p className="ez-ae-label">{Y.eZ.trans('embed', {}, 'onlineeditor')}</p>
</button>
);
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedcenter.js
Expand Up @@ -42,7 +42,7 @@ YUI.add('ez-alloyeditor-button-embedcenter', function (Y) {
return {
alignment: 'center',
classIcon: 'embedcenter',
label: 'Center',
label: Y.eZ.trans('center', {}, 'onlineeditor'),
};
},
});
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedcenter.jsx
Expand Up @@ -37,7 +37,7 @@ YUI.add('ez-alloyeditor-button-embedcenter', function (Y) {
return {
alignment: 'center',
classIcon: 'embedcenter',
label: 'Center',
label: Y.eZ.trans('center', {}, 'onlineeditor'),
};
},
});
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/embedhref.js
Expand Up @@ -41,9 +41,9 @@ YUI.add('ez-alloyeditor-button-embedhref', function (Y) {

getDefaultProps: function () {
return {
udwTitle: "Select a content to embed",
udwTitle: Y.eZ.trans('select.a.content.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: "_updateEmbed",
label: "Select another content item",
label: Y.eZ.trans('select.another.content.item', {}, 'onlineeditor'),
};
},

Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/embedhref.jsx
Expand Up @@ -36,9 +36,9 @@ YUI.add('ez-alloyeditor-button-embedhref', function (Y) {

getDefaultProps: function () {
return {
udwTitle: "Select a content to embed",
udwTitle: Y.eZ.trans('select.a.content.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: "_updateEmbed",
label: "Select another content item",
label: Y.eZ.trans('select.another.content.item', {}, 'onlineeditor'),
};
},

Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedleft.js
Expand Up @@ -42,7 +42,7 @@ YUI.add('ez-alloyeditor-button-embedleft', function (Y) {
return {
alignment: 'left',
classIcon: 'embedleft',
label: 'Left',
label: Y.eZ.trans('left', {}, 'onlineeditor'),
};
},
});
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedleft.jsx
Expand Up @@ -37,7 +37,7 @@ YUI.add('ez-alloyeditor-button-embedleft', function (Y) {
return {
alignment: 'left',
classIcon: 'embedleft',
label: 'Left',
label: Y.eZ.trans('left', {}, 'onlineeditor'),
};
},
});
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedright.js
Expand Up @@ -42,7 +42,7 @@ YUI.add('ez-alloyeditor-button-embedright', function (Y) {
return {
alignment: 'right',
classIcon: 'embedright',
label: 'Right',
label: Y.eZ.trans('right', {}, 'onlineeditor'),
};
},
});
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/embedright.jsx
Expand Up @@ -37,7 +37,7 @@ YUI.add('ez-alloyeditor-button-embedright', function (Y) {
return {
alignment: 'right',
classIcon: 'embedright',
label: 'Right',
label: Y.eZ.trans('right', {}, 'onlineeditor'),
};
},
});
Expand Down
3 changes: 2 additions & 1 deletion Resources/public/js/alloyeditor/buttons/heading.js
Expand Up @@ -56,7 +56,8 @@ YUI.add('ez-alloyeditor-button-heading', function (Y) {

return (
React.createElement("button", {className: css, onClick: this._addHeading, tabIndex: this.props.tabIndex},
React.createElement("span", {className: "ez-ae-icon ae-icon-h1"}), React.createElement("p", {className: "ez-ae-label"}, "Heading")
React.createElement("span", {className: "ez-ae-icon ae-icon-h1"}),
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('heading', {}, 'onlineeditor'))
)
);
},
Expand Down
3 changes: 2 additions & 1 deletion Resources/public/js/alloyeditor/buttons/heading.jsx
Expand Up @@ -51,7 +51,8 @@ YUI.add('ez-alloyeditor-button-heading', function (Y) {

return (
<button className={css} onClick={this._addHeading} tabIndex={this.props.tabIndex}>
<span className="ez-ae-icon ae-icon-h1"></span><p className="ez-ae-label">Heading</p>
<span className="ez-ae-icon ae-icon-h1"></span>
<p className="ez-ae-label">{Y.eZ.trans('heading', {}, 'onlineeditor')}</p>
</button>
);
},
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/image.js
Expand Up @@ -41,7 +41,7 @@ YUI.add('ez-alloyeditor-button-image', function (Y) {
return {
command: 'ezembed',
modifiesSelection: true,
udwTitle: "Select an image to embed",
udwTitle: Y.eZ.trans('select.an.image.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: '_addImage',
udwIsSelectableMethod: '_isImage',
udwLoadContent: true,
Expand Down Expand Up @@ -76,7 +76,7 @@ YUI.add('ez-alloyeditor-button-image', function (Y) {
return (
React.createElement("button", {className: css, onClick: this._chooseContent, tabIndex: this.props.tabIndex},
React.createElement("span", {className: "ez-ae-icon ez-ae-icon-image ez-font-icon"}),
React.createElement("p", {className: "ez-ae-label"}, "Image")
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('image', {}, 'onlineeditor'))
)
);
},
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/image.jsx
Expand Up @@ -36,7 +36,7 @@ YUI.add('ez-alloyeditor-button-image', function (Y) {
return {
command: 'ezembed',
modifiesSelection: true,
udwTitle: "Select an image to embed",
udwTitle: Y.eZ.trans('select.an.image.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: '_addImage',
udwIsSelectableMethod: '_isImage',
udwLoadContent: true,
Expand Down Expand Up @@ -71,7 +71,7 @@ YUI.add('ez-alloyeditor-button-image', function (Y) {
return (
<button className={css} onClick={this._chooseContent} tabIndex={this.props.tabIndex}>
<span className="ez-ae-icon ez-ae-icon-image ez-font-icon"></span>
<p className="ez-ae-label">Image</p>
<p className="ez-ae-label">{Y.eZ.trans('image', {}, 'onlineeditor')}</p>
</button>
);
},
Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/imagehref.js
Expand Up @@ -43,11 +43,11 @@ YUI.add('ez-alloyeditor-button-imagehref', function (Y) {

getDefaultProps: function () {
return {
udwTitle: "Select an image to embed",
udwTitle: Y.eZ.trans('select.an.image.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: "_updateEmbed",
udwIsSelectableMethod: '_isImage',
udwLoadContent: true,
label: "Select another image",
label: Y.eZ.trans('select.another.image', {}, 'onlineeditor'),
};
},

Expand Down
4 changes: 2 additions & 2 deletions Resources/public/js/alloyeditor/buttons/imagehref.jsx
Expand Up @@ -38,11 +38,11 @@ YUI.add('ez-alloyeditor-button-imagehref', function (Y) {

getDefaultProps: function () {
return {
udwTitle: "Select an image to embed",
udwTitle: Y.eZ.trans('select.an.image.to.embed', {}, 'onlineeditor'),
udwContentDiscoveredMethod: "_updateEmbed",
udwIsSelectableMethod: '_isImage',
udwLoadContent: true,
label: "Select another image",
label: Y.eZ.trans('select.another.image', {}, 'onlineeditor'),
};
},

Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/list.js
Expand Up @@ -60,7 +60,7 @@ YUI.add('ez-alloyeditor-button-list', function (Y) {
return (
React.createElement("button", {className: css, onClick: this._addList, tabIndex: this.props.tabIndex},
React.createElement("span", {className: "ez-ae-icon ae-icon-bulleted-list"}),
React.createElement("p", {className: "ez-ae-label"}, "List")
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('list', {}, 'onlineeditor'))
)
);
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/list.jsx
Expand Up @@ -55,7 +55,7 @@ YUI.add('ez-alloyeditor-button-list', function (Y) {
return (
<button className={css} onClick={this._addList} tabIndex={this.props.tabIndex}>
<span className="ez-ae-icon ae-icon-bulleted-list"></span>
<p className="ez-ae-label">List</p>
<p className="ez-ae-label">{Y.eZ.trans('list', {}, 'onlineeditor')}</p>
</button>
);
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/paragraph.js
Expand Up @@ -58,7 +58,7 @@ YUI.add('ez-alloyeditor-button-paragraph', function (Y) {
return (
React.createElement("button", {className: css, onClick: this._addParagraph, tabIndex: this.props.tabIndex},
React.createElement("span", {className: "ez-ae-icon ez-ae-icon-paragraph"}),
React.createElement("p", {className: "ez-ae-label"}, "Paragraph")
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('paragraph', {}, 'onlineeditor'))
)
);
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/alloyeditor/buttons/paragraph.jsx
Expand Up @@ -53,7 +53,7 @@ YUI.add('ez-alloyeditor-button-paragraph', function (Y) {
return (
<button className={css} onClick={this._addParagraph} tabIndex={this.props.tabIndex}>
<span className="ez-ae-icon ez-ae-icon-paragraph"></span>
<p className="ez-ae-label">Paragraph</p>
<p className="ez-ae-label">{Y.eZ.trans('paragraph', {}, 'onlineeditor')}</p>
</button>
);
},
Expand Down
12 changes: 6 additions & 6 deletions Resources/public/js/alloyeditor/toolbars/config/heading.js
Expand Up @@ -16,12 +16,12 @@ YUI.add('ez-alloyeditor-toolbar-config-heading', function (Y) {
name: 'styles',
cfg: {
styles: [
{name: 'Heading 1', style: {element: 'h1'}},
{name: 'Heading 2', style: {element: 'h2'}},
{name: 'Heading 3', style: {element: 'h3'}},
{name: 'Heading 4', style: {element: 'h4'}},
{name: 'Heading 5', style: {element: 'h5'}},
{name: 'Heading 6', style: {element: 'h6'}},
{name: Y.eZ.trans('heading.1', {}, 'onlineeditor'), style: {element: 'h1'}},
{name: Y.eZ.trans('heading.2', {}, 'onlineeditor'), style: {element: 'h2'}},
{name: Y.eZ.trans('heading.3', {}, 'onlineeditor'), style: {element: 'h3'}},
{name: Y.eZ.trans('heading.4', {}, 'onlineeditor'), style: {element: 'h4'}},
{name: Y.eZ.trans('heading.5', {}, 'onlineeditor'), style: {element: 'h5'}},
{name: Y.eZ.trans('heading.6', {}, 'onlineeditor'), style: {element: 'h6'}},
]
}
};
Expand Down
Expand Up @@ -136,7 +136,7 @@ YUI.add('ez-translateactionview', function (Y) {
e.preventDefault();
this.fire('languageSelect', {
config: {
title: "Select a language for your new translation:",
title: Y.eZ.trans('select.a.language.for.new.translation', {}, 'bar'),
languageSelectedHandler: Y.bind(this._newTranslation, this),
cancelLanguageSelectionHandler: null,
canBaseTranslation: true,
Expand Down