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

multilingual javascript #38

Open
micuat opened this issue Mar 22, 2018 · 1 comment
Open

multilingual javascript #38

micuat opened this issue Mar 22, 2018 · 1 comment

Comments

@micuat
Copy link
Contributor

micuat commented Mar 22, 2018

from #37 (comment)

Currently the demo javascripts are hardcoded with english texts but they should be translated too. I tested i18next and it seems working well, which can be found in my branch:
master...micuat:js-multilng

@micuat
Copy link
Contributor Author

micuat commented Mar 24, 2018

@genekogan in this branch I added i18next library for multilingual javascript (only for simple forward pass demo with en/fr by google translate): master...micuat:js-multilng

One observation is that, in the branch above I naively moved all the variables to be input to i18next

set_text_panel(parent.description_panel_div,
	i18next.t('segment7', {in0: y_correct, in1: y_correct.toFixed(2), in2: acts[2][0].toFixed(2), in3: error.toFixed(3)}),
	true);

but maybe latex equations should be formatted before passing to i18next like this

set_text_panel(parent.description_panel_div,
	i18next.t('segment7', {in0: y_correct, in1: '\\begin{aligned} \
	\\text{mse} &= ('+y_correct.toFixed(2)+' - '+acts[2][0].toFixed(2)+')^2 \\\\ \
	\\text{mse} &= '+error.toFixed(3)+' \
	\\end{aligned}'}),
	true);

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

1 participant