Skip to content

Commit

Permalink
update lang and location when translating the page
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomm19 committed Jul 21, 2023
1 parent 49c4fd6 commit 7b3158d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/components/NavbarDesktop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ export const Navbar = ({
(contentBar.active && !isDevelopment());

const langDictionary = {
us: 'es',
es: 'us',
us: "es",
es: "us",
};

const locations = locByLanguage(data.allLocationYaml, langDictionary[lang]);
Expand Down Expand Up @@ -284,11 +284,13 @@ export const Navbar = ({
</Menu>
<Div alignItems="center" justifyContent="between">
<Link
onClick={() => setSession({
...session,
language: langDictionary[lang],
locations,
})}
onClick={() =>
setSession({
...session,
language: langDictionary[lang],
locations,
})
}
to={
session && session.pathsDictionary && currentURL
? `${session.pathsDictionary[currentURL] || ""}${
Expand Down
3 changes: 2 additions & 1 deletion src/templates/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ const Calendar = (props) => {
margin="10px 0"
textColor="white"
>
{session?.location?.button.apply_button_text || content.cohorts.info.button_text}
{session?.location?.button.apply_button_text ||
content.cohorts.info.button_text}
</Button>
</Link>
</Div>
Expand Down

0 comments on commit 7b3158d

Please sign in to comment.