Skip to content

Add language routing #7160

Open
wants to merge 14 commits into from

5 participants

@BerkeleyTrue

No description provided.

@BerkeleyTrue BerkeleyTrue changed the title from [WIP] Add language routing to [WIP] Add language routing
@BerkeleyTrue BerkeleyTrue added QA and removed blocked labels
@QuincyLarson

@BerkeleyTrue I can change my preferred language to Spanish, but it doesn't affect the language of the challenges.

@bugron

Here is what I see both in Firefox and Chrome respectively (even if I select something):


When I change the language the map is still in English

And I think we should change "Preferred language" to "Preferred language of challenges" because one can thought that changing the lang will change everything but it actually changes only challenge seed's language.
And for future approach I think it would be better to have test messages translated too. As a user I feel like translation is not completed now.

@BerkeleyTrue

I'll work on the map.

And I think we should change "Preferred language" to "Preferred language of challenges"

We're asking when language they preferred. I don't think we need the extra qualifier.

BerkeleyTrue added some commits
@BerkeleyTrue BerkeleyTrue Add language url structure
Displays challenge in specified language if supported
otherwise defaults to English.

New languages can be added with one line change.
079f594
@BerkeleyTrue BerkeleyTrue Pass index if no lang
Pass through /auth routes
b359b0e
@BerkeleyTrue BerkeleyTrue add language aware redirect f2a9cda
@BerkeleyTrue BerkeleyTrue Fix login baths fabcc00
@BerkeleyTrue BerkeleyTrue Save user language from profile page 949d5bc
@BerkeleyTrue BerkeleyTrue Loopback generator normalizing models ecfb33b
@BerkeleyTrue BerkeleyTrue Fix home next call on no lang defined 88f9d67
@BerkeleyTrue BerkeleyTrue Add user lang redirect ce7a3d9
@BerkeleyTrue BerkeleyTrue Fix home route not rendering
fabc4cb
@BerkeleyTrue BerkeleyTrue Add language titles to challenge map
4cf26cd
@BerkeleyTrue

Added language support on maps. Superblocks/blocks will need title translations as well, but we'll cross that bridge at some other point

@BerkeleyTrue

I'll leave the select css stuff to someone with more skills than I, like @hallaathrad.

@BerkeleyTrue

Still need to figure out why React stuff keeps cycling.

@BerkeleyTrue BerkeleyTrue Remove lang routing on React parts
2dfe2e8
@BerkeleyTrue BerkeleyTrue changed the title from [WIP] Add language routing to Add language routing
@BerkeleyTrue BerkeleyTrue Select language if already set
727312e
@BerkeleyTrue

Live on Beta

@BerkeleyTrue BerkeleyTrue Make select auto update
b970c43
@QuincyLarson

OK - I've found a couple issues:

  • If I'm unauthenticated and I complete a challenge, it will send me to the map and say "We couldn't find a challenge with the name next-challenge. Please double check the name."
  • If I'm authenticated and I complete a challenge with either Spanish or English as my chosen language, it will never advance to the next challenge (it shows the spinner forever).
@BerkeleyTrue BerkeleyTrue Move completed-challenges out of language redirect
fix type for next-challenge
bb3f821
@ltegman
Free Code Camp member

@BerkeleyTrue It saves challenges to the user object with the translated name, so if someone completes a challenge in spanish anyone who visits that profile will see the name in spanish rather than english, and because the spanish version of the name is not a valid URL they will get an error like We couldn't find a challenge with the name Borra elementos HTML. Please double check the name. when trying to visit the solution from the link profile link.

@ltegman ltegman added blocked and removed QA labels
@BerkeleyTrue

@ltegman Thanks. We'll definitely need to incorporate language routing into find next challenge. I guess we'll need to parse the lang from the url and search the appropriate language name.

@ltegman
Free Code Camp member

@BerkeleyTrue I don't know how practical this is but is there any chance we can store the challenge with the english name in the user object and translate what is shown on the user profile? Seems like saving it in a consistent fashion and translating from there would have less potential side effects on things like challenge validation for certs and mean all our users can easily view each others challenges regardless of the language the user completed the challenge in.

@BerkeleyTrue

@ltegman I've actually been thinking of creating a id => name map to use on profiles. This would solve other issue's were having with the profile and always keep the names up to date. We could make a map per language.

@ltegman
Free Code Camp member

@BerkeleyTrue That sounds like an excellent solution for this!

@vtamara
Free Code Camp member
@BerkeleyTrue

@vtamara I've since taken it down from beta. I'll put it back up when I fix the issue reported by @ltegman

@vtamara
Free Code Camp member

Thank you

@bugron

@BerkeleyTrue, please, rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.