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

FES i18n: Loading translation files from CDN #4694

Closed
2 tasks done
akshay-99 opened this issue Jul 14, 2020 · 1 comment · Fixed by #4701
Closed
2 tasks done

FES i18n: Loading translation files from CDN #4694

akshay-99 opened this issue Jul 14, 2020 · 1 comment · Fixed by #4701

Comments

@akshay-99
Copy link
Member

Most appropriate sub-area of p5.js?

  • Friendly Errors
  • Internationalization

Feature enhancement details:

Internationalization was introduced to the FES in #4233. So far we only have English strings for the FES and even that file is starting to get pretty big, and could grow even bigger if more functionality is added or when translations are added for all of these and these messages.

In the future, when we have translations for more and more languages, all of this may take up a lot of space within the library.

As @outofambit and @limzykenneth discussed in #4233, we can host the translation files on a CDN and then fetch whichever file is needed depending on the language detected by i18next-browser-languageDetector. The English translation will serve as a fallback in case something goes wrong while fetching from the CDN. Another option could be to package translations into the zip, with instructions on how to load one.

I am more inclined towards the first option as it does not require extra work and understanding on the user's part. Maybe we can implement the second option too, to have translated messages when running offline.
Translations could be updated with new releases of p5.

I can work on updating the internationalization code, the build process, the release process to implement this.
We should also have another issue to let new contributors know that we are looking for help in adding translations for all languages. 😄

@limzykenneth
Copy link
Member

The CDN option seems good to me. We can package the English version into the library itself so something is always available offline. In the future it would be nice if the website itself can package the appropriate langauge version into the library download depending on which language the user is viewing the website in, but that's much more advanced.

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

Successfully merging a pull request may close this issue.

2 participants