espterm / espterm-firmware

ESPTerm - ESP8266 terminal emulator. Branches: [master] patches, [work] next release
Mozilla Public License 2.0
126 stars 24 forks source link

switchable languages........ #245

Open MightyPork opened 6 years ago

MightyPork commented 6 years ago

if we exclude the help page, that's like 35 kB uncompressed per language, not a huge deal - we just must figure out how to have multiple languages in js

MightyPork commented 6 years ago

presumably the active language could be defined in a similar way to _demo or _root.

this won't work for the help page, so we must ensure there are no tr() uses - but i think the only js there atm is building the (still very ugly) color preview

cpsdqs commented 6 years ago

the webpack loader can easily load multiple languages—I have no idea about the PHP though. Maybe the server could perform substitutions instead of having a bunch of duplicate data?

MightyPork commented 6 years ago

it could. i'm not sure that's worth it, as it'd require exporting the constants to C and building some horrible look-up table with an x-macro. it could be really slow...

MightyPork commented 6 years ago

oh, and the help page is pre-gzipped, so we can't do any replacements on that (i.e. the menu) which .. uhhhhhh is a problem. might need to figure out some js hack with a get parameter

cpsdqs commented 6 years ago

well you could do it all from javascript but then you'd need to have javascript enabled on every page

MightyPork commented 6 years ago

hmmpf

let's maybe not, for now. although japascript is on every page afaik

cpsdqs commented 6 years ago

well, if you do decide to do this, use the smallest method lest it take up like 100Mb

MightyPork commented 6 years ago

i hope your js translation plan is something more sophisticated than what my router is using

screenshot_20171004_235918

screenshot_20171004_235904

MightyPork commented 6 years ago

they certainly don't give a damn about file size there with keys like this screenshot_20171005_000128

cpsdqs commented 6 years ago

before I accidentally express my opinion on that code I'll just answer the question with a ‘yes very much so’ xD