p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Reference download only in English

Open montoyamoraga opened this issue 6 years ago • 5 comments

When you download the offline reference, it is only in English, even if you are browsing on the Spanish or Chinese versions.

Is it an issue of having to run a local server so that the JS files do their thing and translate? Or maybe the JS files are not included? I could not figure it out.

Also, the file names are the same, it would be cool for the Spanish one to be either p5-reference-es or even p5-referencia.

In the meantime, I told people at the Processing forum to please excuse us and to use the online reference and even the Spanish book.

montoyamoraga avatar Nov 04 '18 14:11 montoyamoraga

The offline reference generating step probably didn't include the translated versions. The html page probably also does not have links to switch between the versions.

Are you thinking more of having seperate versions (ie. Spanish and Chinese versions) of the offline reference or just one version that you can switch between them?

limzykenneth avatar Nov 05 '18 09:11 limzykenneth

@montoyamoraga as an user, I would love to switch between them, not having separate downloads, can I help with developing this? I don't where to start.

montoyamoraga avatar Nov 05 '18 15:11 montoyamoraga

The build step for the offline reference is a good place to start as it shows how the whole package is assembled from different parts (this part as well).

One particular thing to note is the renaming of data.json to data.js while also prepending referenceData = to the start of the file. This is done to get around the problem of cross origin request while opening from the file:// path. I imagine it will be the case of doing the same with the translated versions as well and loading them all in alongside the original version onto the webpage, as we are not serving over the internet file size is not as much a concern.

Then to include the options to switch languages, you'll probably need to edit files in offline-reference/extra. You may need to go through very long and complicated js file to find the right place to edit though.

Anything else you are not sure about just let me know.

limzykenneth avatar Nov 05 '18 15:11 limzykenneth

thanks @limzykenneth ! It seems challenging to me, but I will try!

montoyamoraga avatar Nov 13 '18 05:11 montoyamoraga

i am assigning myself this issue to tackle it, i will tag @limzykenneth when i hit a roadblock :)

montoyamoraga avatar Oct 10 '19 17:10 montoyamoraga