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

Fixes 2963: Add front-end translation functionality #3062

Merged

Conversation

AmasiaNalbandian
Copy link
Contributor

@AmasiaNalbandian AmasiaNalbandian commented Feb 26, 2022

Issue This PR Addresses

Fixes #2963

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Adds ability to translate the web app in various languages, depending on the keys we provide.

  • as this is its own component and we are only translating the about page, I can move this into the about page only. We can also translate more pages, we just add more keys to the translation files.

Steps to test the PR

  • Use the deployment, and you will see the top right has a drop down for language selection. When you change to spanish, you will see the two menu items change to spanish keys, and same when you put back to english.
  • When you refresh it keeps the state of the language, however I have not finished with the select drop-down so it resets to say "language" again.

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@gitpod-io
Copy link

gitpod-io bot commented Feb 26, 2022

src/web/package.json Outdated Show resolved Hide resolved
@manekenpix
Copy link
Member

Something I'm not sure about, do we control what's displayed in the selector? I see Espanol instead of Español, is there a way to change that?

@humphd
Copy link
Contributor

humphd commented Mar 9, 2022

This PR is for functionality - not UI. I made an issue for the UI here: #3141

I think we should consider folding #3141 into this, as I don't think that the UI is ready to land yet. Could we do something minor in this PR (at least proper colour contrast) and improve it in #3141?

Kevan-Y
Kevan-Y previously approved these changes Mar 9, 2022
Copy link
Contributor

@Kevan-Y Kevan-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can land this and have a better UI in a follow up

tpmai22
tpmai22 previously approved these changes Mar 10, 2022
Copy link
Contributor

@tpmai22 tpmai22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweat and tears ! Great work, LGTM.

@tpmai22 tpmai22 requested a review from Kevan-Y March 10, 2022 01:51
DukeManh
DukeManh previously approved these changes Mar 10, 2022
@tpmai22
Copy link
Contributor

tpmai22 commented Mar 10, 2022

@AmasiaNalbandian There some conflict which might be usefull if you take a look at the doc if you ever feel hard to resolve the conflict. Hope this help

tpmai22
tpmai22 previously approved these changes Mar 11, 2022
tcvan0707
tcvan0707 previously approved these changes Mar 11, 2022
import Fragment from react (Seneca-CDOT#3133)

Switched twitch iframe from `twitch.tv` to `player.twitch.tv` (Seneca-CDOT#3023)

added next-i18next

fixed errors to run i18next

added more translations

added next-i18next

fixed errors to run i18next

added more translations

removed de language

fixed translation

attempting to use i18 without next

added language routing

prettier fix

renamed component

fixed typo

revert formatting in package.json

revert formatting in package.json

removed extra css

Update type

Co-authored-by: Josue <[email protected]>

cleaned code

updated pnpm-lock.yaml

added language array for rendering list of languages

coding fixes

added key

Revert "fix: use proper way to require express-handlebars"

This reverts commit 83b9631.

fix: use proper way to require express-handlebars

import Fragment from react (Seneca-CDOT#3133)

Switched twitch iframe from `twitch.tv` to `player.twitch.tv` (Seneca-CDOT#3023)

added next-i18next

fixed errors to run i18next

added more translations

added next-i18next

fixed errors to run i18next

added more translations

removed de language

fixed translation

attempting to use i18 without next

added language routing

prettier fix

renamed component

fixed typo

revert formatting in package.json

revert formatting in package.json

removed extra css

Update type

Co-authored-by: Josue <[email protected]>

cleaned code

updated pnpm-lock.yaml

added language array for rendering list of languages

coding fixes

added key

added getlang fn

moved translation to about page

revert capital

added CSS to selectbox

new pnpm-lock

restored bannerbuttons file
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.

Add language switch functionality in the front-end
8 participants