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

[POC] Weglot Translation #1187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tpetersen0308
Copy link
Contributor

This PR is a POC for migrating translation services from Google to Weglot. To test, run the application and select a different language in the bottom right corner.

@tpetersen0308
Copy link
Contributor Author

tpetersen0308 commented Nov 2, 2022

Sometimes I have to refresh to get the whole page translated. This could be because it's difficult for Weglot to detect certain dynamic elements; they allow you to add CSS selectors to elements to remedy this.

I applied the translatable class to some elements to test this out (I had to configure this in the Weglot UI as well). You can see the difference by:

  • entering a form that uses the RadioFormStep component (like long-term housing).

  • change the language

  • notice that you must refresh to see the translation, as this component does not have the translatable class applied.

  • entering a form that users the FormStep component (like jobs).

  • change the language

  • notice that the translation is immediately applied to the component, as it does have the translatable class applied.

@tpetersen0308
Copy link
Contributor Author

It also looks like we can add custom CSS to the language switcher, so we may be able to control its appearance/location on the page.

@schroerbrian
Copy link
Contributor

Strangely I am unable to see the menu locally. Am I missing a step somehow?

@richardxia
Copy link
Member

Strangely I am unable to see the menu locally. Am I missing a step somehow?

I think you have to rerun npm run build to rebuild/copy index.html. This is normally something we only do once when first setting up the repo for local development, but since this is a rare PR that touches that file, you have to rerun that command to build and copy that file into the directory that webpack will serve it out of.

I tested this locally for myself, and I only see the Weglot widget after I run npm run build and restart my webpack dev server.

@richardxia
Copy link
Member

Sometimes I have to refresh to get the whole page translated. This could be because it's difficult for Weglot to detect certain dynamic elements; they allow you to add CSS selectors to elements to remedy this.

Just as another data point, I'm also seeing this behavior locally, where I have to refresh the page for the translations to actually take effect.

@drcaramelsyrup
Copy link
Contributor

Although I think we're still interested in Google Translate solution for most of our white labels, Our415 is now definitely interested in being able to do this on their white label (configured with their own API account).
Is there still ongoing work on this or should I try to resume progress on this PR?

@tpetersen0308
Copy link
Contributor Author

Although I think we're still interested in Google Translate solution for most of our white labels, Our415 is now definitely interested in being able to do this on their white label (configured with their own API account). Is there still ongoing work on this or should I try to resume progress on this PR?

This was just a POC for Weglot to see if it would work, and if we wanted to use it. Feel free to resume work on this branch as an actual feature or check out a new one!

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

Successfully merging this pull request may close these issues.

None yet

4 participants