-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(locale): language switching (#215)
* feat(language): Add default redirect functionality to ES Implemented functionality to redirect to Spanish by default * feat(language): add language change button The implemented functionality added a language button with options for Spanish (ES) and English (EN). * refactor: reduce coupling and magic strings * fix: refactor data exchange signature * refactor: add last name boolean filtering fixes the " undefined" on `last` trait when second last name was `undefined` * fix (cicd): Adding right permissions to pipelines * fix (cicd): Adding right permissions to pipelines * Update cd-deploy-to-prod.yml * Update cd-deploy-to-test.yml * Update ci-check-linters.yml * Update ci-unit-tests.yml * Update delete-deployment.yml * Update sub-build-push-image.yml * Update sub-cloudrun-deploy.yml * fix(router): change route redirection method Replaced router.push with window.location.href to address caching issue when changing language. * bump: v1.1.3 * fix: remove direct language reference --------- Co-authored-by: Jeffrey Mesa <[email protected]> Co-authored-by: Kevin Jimenez <[email protected]> Co-authored-by: Marluan Espiritusanto <[email protected]>
- Loading branch information
1 parent
25700b5
commit 863a1c6
Showing
22 changed files
with
103 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: Deploy to Cloud Run | ||
|
||
permissions: read-all | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Image from 'next/image'; | ||
|
||
import esicon from '@public/assets/es-language.svg'; | ||
import enicon from '@public/assets/en-language.svg'; | ||
import esdata from '../../dictionaries/es.json'; | ||
import endata from '../../dictionaries/en.json'; | ||
|
||
import { ButtonApp } from '@/components/elements/button'; | ||
import { Locale } from '@/i18n-config'; | ||
|
||
const locales = { | ||
es: { | ||
icon: esicon.src, | ||
name: esdata.languageName, | ||
}, | ||
en: { | ||
icon: enicon.src, | ||
name: endata.languageName, | ||
}, | ||
}; | ||
|
||
export const LanguageSelector = ({ other }: { other: Locale }) => { | ||
const changeLanguage = () => { | ||
window.location.href = `/${other}/identification`; | ||
}; | ||
|
||
return ( | ||
<div style={{ marginRight: 16 }}> | ||
<ButtonApp | ||
variant="outlined" | ||
startIcon={ | ||
<Image | ||
src={locales[other].icon} | ||
alt="language icon" | ||
width="24" | ||
height="24" | ||
/> | ||
} | ||
onClick={changeLanguage} | ||
> | ||
{locales[other].name} | ||
</ButtonApp> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"languageName": "English", | ||
"language": "en", | ||
"common": { | ||
"title": "Cuenta Única Ciudadana", | ||
"hello": "Hello", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"languageName": "Español", | ||
"language": "es", | ||
"common": { | ||
"title": "Cuenta Única Ciudadana", | ||
"hello": "Hola", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters