Skip to content
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

Remove var Translator = new Translate... from every page #24

Closed
stalniy opened this issue Jun 8, 2012 · 7 comments
Closed

Remove var Translator = new Translate... from every page #24

stalniy opened this issue Jun 8, 2012 · 7 comments

Comments

@stalniy
Copy link

stalniy commented Jun 8, 2012

You must remove this JS because it's bad for SEO it's bad for mobile and it's bad for users that use 3G modems. I undestand that this code need for translations in JavaScript, but you can get it using AJAX! During page loading just send AJAX request to some controller that will return translations in JSON format.
It will also decrease time of page loading.

And it's useful you may check this thread http://www.magentocommerce.com/boards/viewthread/9307/ .

@colinmollenhour
Copy link

This would best be handled by merging it with the other JS files into the main merged JS file so it can be cached in the browser and not require an Ajax request. Also using Ajax would complicate using the Translator because you'd have to wait until it was loaded.

@stalniy
Copy link
Author

stalniy commented Jun 9, 2012

Yes you are right, your suggestion is better. But also with AJAX you must not wait response. Because all translation for JS in general is used for form validation. And all translations can be fetched before user make some actions

@magento-team
Copy link
Contributor

Hi, stalniy,

thank you for the proposal. We already have people working on this topic.

The translations will be moved from page source to an automatically pre-composed static Javascript file, thus they won't affect SEO in any way. And the file will be cached by the user's browser, thus it won't consume network traffic upon each request.

Closing the issue.

This was referenced Mar 4, 2015
@stevieyu stevieyu mentioned this issue Apr 3, 2015
@FabXav FabXav mentioned this issue Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants