Skip to content

ImportExport module missing some translation #24017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/code/Magento/ImportExport/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@ Summary,Summary
"New product data is added to existing product data entries in the database. All fields except SKU can be updated.","New product data is added to existing product data entries in the database. All fields except SKU can be updated."
"All existing product data is replaced with the imported new data. <b>Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost.</b>","All existing product data is replaced with the imported new data. <b>Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost.</b>"
"Any entities in the import data that match existing entities in the database are deleted from the database.","Any entities in the import data that match existing entities in the database are deleted from the database."
"Invalid data","Invalid data"
"Invalid response","Invalid response"
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ require([
form.action = oldAction;
} else {
alert({
content: 'Invalid data'
content: '<?= $block->escapeHtml(__('Invalid data')); ?>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use mage/translation instead of block method

Copy link
Contributor Author

@edenduong edenduong Aug 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov : I don't know the reason but the first time of this PR, I use the mage/translate. And it can not translate. Could you please try it?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ require([
postToFrameProcessResponse: function(response) {
if ('object' != typeof(response)) {
alert({
content: 'Invalid response'
content: '<?= $block->escapeHtml(__('Invalid response')); ?>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use mage/translation instead of block method

Copy link
Contributor Author

@edenduong edenduong Aug 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov : I don't know the reason but the first time of this PR, I use the mage/translate. And it can not translate. Could you please try it?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

escapeHtml method does not translate strings, it just removes special characters from the string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov : Yes, but __(‘...’) translate the string. And the code now can translate. I use escapeHtml because I make it similar many place in Magento now. It is strange because the code escapeHtml of ‘fixed’ string. I can remove that code if you want.
I mean the mage/translate can not translate in this case (I don’t know but I may be a bug of mage/translate) . So I use translate by ‘block’.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov :I think escapeHtml to Secure the change of csv file can include the “html” code. So it is the reason escapeHtml of __(‘...’) function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edenduong looks like @engcom-Alfa didn't clear the cache after changes were applied. mage/translate works similar to __() function on the backend. Please, revert back changes to use mage/translate and I'll accept your PR. I'm sorry for the inconvenience.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov : I don't know the reason but mage/translate can not translate. (I have cleared cache). I tested it. Could you please try to edit it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edenduong you are right looks like mage/translate does not work in phtml file, it's working on js only. Thank you for the clarification!

});

return false;
Expand Down