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

i18n file too large #97

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

i18n file too large #97

neocotic opened this issue Apr 20, 2012 · 2 comments
Assignees
Milestone

Comments

@neocotic
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

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).

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

No branches or pull requests

1 participant