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

i18n file too large #97

Closed
neocotic opened this Issue Apr 20, 2012 · 2 comments

Comments

Projects
None yet
1 participant
@neocotic
Member

neocotic commented Apr 20, 2012

Shrink the messages.json file after seeing errors while trying to update 1.0.8. Reduce the length of descriptions (within reason) and, possibly, abstract the guide out to be standalone HTML files.

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic May 8, 2012

Member

A possible workaround, at least for now, is to compress the messages.json file(s) when building distribution file.

The simplest concept would be to read the contents of each messages.json file, parse that string as a JSON object (JSON.parse), recreate the string from the JSON object (JSON.stringify), which should then be written back to the original file. Since JSON.stringify doesn't create a pretty output, the ignored whitespace should reduce the file size by approx. 25-30KB.

This workaround will only work up to the point where even this compression won't make a difference. It appears the file size limit is somewhere around 132KB. Also, other languages may use more or less bytes which could cause a problem, so the idea of splitting the JSON file up appeals to me greatly but I want to make sure I do it right. Ideally, Chrome wouldn't have a file size limit on these file, or at least a much higher limit to encourage the use of i18n.

Member

neocotic commented May 8, 2012

A possible workaround, at least for now, is to compress the messages.json file(s) when building distribution file.

The simplest concept would be to read the contents of each messages.json file, parse that string as a JSON object (JSON.parse), recreate the string from the JSON object (JSON.stringify), which should then be written back to the original file. Since JSON.stringify doesn't create a pretty output, the ignored whitespace should reduce the file size by approx. 25-30KB.

This workaround will only work up to the point where even this compression won't make a difference. It appears the file size limit is somewhere around 132KB. Also, other languages may use more or less bytes which could cause a problem, so the idea of splitting the JSON file up appeals to me greatly but I want to make sure I do it right. Ideally, Chrome wouldn't have a file size limit on these file, or at least a much higher limit to encourage the use of i18n.

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic May 9, 2012

Member

I've updated the Cakefile (6216a1c) to minify the i18n messages.json files when building the distribution file. It appears to work fine with no problems so this should buy some time for now. I'll raise a new issue to provide additional help with this issue, potentially dividing the contents to multiple files (not ideal as I'd prefer to just use chrome.i18n.getMessage).

Member

neocotic commented May 9, 2012

I've updated the Cakefile (6216a1c) to minify the i18n messages.json files when building the distribution file. It appears to work fine with no problems so this should buy some time for now. I'll raise a new issue to provide additional help with this issue, potentially dividing the contents to multiple files (not ideal as I'd prefer to just use chrome.i18n.getMessage).

@neocotic neocotic closed this May 9, 2012

@neocotic neocotic added bug config i18n and removed Error labels Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment