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

Feature/migrate nexti18next to nextintl #1967

Merged
merged 82 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1211737
chore: install next-intl packages
mohitb35 Jan 30, 2024
4600f25
refactor: move pages into sites/[slug][locale] subfolder
mohitb35 Jan 30, 2024
8962eec
feat: set up i18n.ts and typescript for messages
mohitb35 Feb 15, 2024
a90b7fc
Merge from 'feature/my_forest' to feature/migrate-nexti18next-to-next…
mohitb35 Feb 15, 2024
4578a48
feat: set up middleware for i18n routing
mohitb35 Feb 16, 2024
19cfdd9
feat: adds default fallback behaviour for unsupported locales in url
mohitb35 Feb 19, 2024
c59f9d0
feat: sets up static paths for locale all routes
mohitb35 Feb 19, 2024
28c70ce
fix: fixes invalid import path
mohitb35 Feb 19, 2024
80399ad
feat: integrates next-intl with / route
mohitb35 Feb 20, 2024
549fc1d
Merge from 'feature/my_forest' to feature/migrate-nexti18next-to-next…
mohitb35 Feb 21, 2024
472876a
feat: updates LanguageSelection logic (footer)
mohitb35 Feb 21, 2024
4c431ed
feat: enclose translation files in outer namespace (de/en only)
mohitb35 Feb 21, 2024
4e79720
feat: adapts interpolation text format in translation files for next-…
mohitb35 Feb 21, 2024
a9cce0c
feat: updates translation code in components
mohitb35 Feb 22, 2024
9411162
feat: integrates next-intl with project details page
mohitb35 Feb 23, 2024
4c13cb9
Merge from 'develop' to feature/migrate-nexti18next-to-nextintl
mohitb35 Feb 29, 2024
beb63f2
feat: integrates next-intl with login page
mohitb35 Mar 4, 2024
b025ab8
feat: integrates next-intl with /profile
mohitb35 Mar 4, 2024
6fbc46d
feat: sets up next-intl for settings/widget pages
mohitb35 Mar 4, 2024
c2c22ce
refactor: introduces getMessagesForPage utility function
mohitb35 Mar 4, 2024
285eb1c
feat: integrates next-intl with pages (part 1)
mohitb35 Mar 4, 2024
1f545fc
feat: integrates next-intl with pages (part 2)
mohitb35 Mar 4, 2024
5a8d090
feat: integrates next-intl with pages (part 3)
mohitb35 Mar 5, 2024
7358a59
refactor: updates getMessagesForPage to import JSON files correctly
mohitb35 Mar 5, 2024
5565f1f
fix: remove unused deepmerge imports
mohitb35 Mar 5, 2024
47b7048
refactor: refactor Props interface for pages to include PageProps
mohitb35 Mar 5, 2024
32fcac3
feat: integrates next-intl on 404 page
mohitb35 Mar 8, 2024
c3aaa4f
feat: migrates existing translation files from i18next to next-intl f…
mohitb35 Mar 8, 2024
5a4c510
refactor: updates localization strings as per next-intl
mohitb35 Mar 8, 2024
3a2cc88
feat: integrates next-intl with storybook
mohitb35 Mar 11, 2024
a64fe1d
refactor: remove unused dependencies/code relating to i18next
mohitb35 Mar 11, 2024
be05aad
Merge 'develop' to feature/migrate-nexti18next-to-nextintl
mohitb35 Mar 12, 2024
debad20
refactor: removes unused login.json translation files
mohitb35 Mar 12, 2024
150bae6
refactor: removes i18next pluralization related strings
mohitb35 Mar 12, 2024
def1f0a
fix: corrects typos in translation namespaces
mohitb35 Mar 13, 2024
74da2b5
🌐 Language update from LingoHub 🤖
lingohub[bot] Mar 13, 2024
dd046bd
Merge pull request #2004 from Plant-for-the-Planet-org/lingohub_langu…
mohitb35 Mar 13, 2024
bf5ce3b
🌐 Language update from LingoHub 🤖
lingohub[bot] Mar 13, 2024
b535166
Merge pull request #2005 from Plant-for-the-Planet-org/lingohub_langu…
mohitb35 Mar 13, 2024
9c783e9
fix: resolves missing message warning in SelectLanguageAndCountry
mohitb35 Mar 13, 2024
f8cbe30
refactor: removes commented import
mohitb35 Mar 13, 2024
cf6f092
fix: update localeRegex used in removeLocaleFromUrl
mohitb35 Mar 13, 2024
cbf739b
fix: resolves missing message warning for Edit Profile
mohitb35 Mar 13, 2024
031b5a0
refactor: refactor i18nConfig and locale logic in middleware
mohitb35 Mar 13, 2024
94abc57
refactor: handles errors in getLocale function
mohitb35 Mar 13, 2024
58196f0
refactor: removes console logs
mohitb35 Mar 13, 2024
6adf1ce
fix: removes unsupported country option
mohitb35 Mar 13, 2024
953271d
fix: updates checks on `asPath` in profile to include `locale`
mohitb35 Mar 13, 2024
c398f95
Merge branch 'develop' into feature/migrate-nexti18next-to-nextintl
mohitb35 Mar 18, 2024
d24c1f5
refactor: removes instances of destructuring of `router` for code rea…
mohitb35 Mar 20, 2024
c6d36ab
fix: minor updates to usage of `router` within pages/
mohitb35 Mar 20, 2024
0011963
fix: resolves github-advanced-security warning for URL containing use…
mohitb35 Mar 21, 2024
48b91f2
fix: removes unused `language` from QueryParamsContext
mohitb35 Mar 21, 2024
19187ad
refactor: updates DirectGift to use Link instead of useRouter
mohitb35 Mar 21, 2024
7118d91
refactor: reduces duplication in project navigation logic in Markers …
mohitb35 Mar 21, 2024
b2fd3fa
refactor: removes instances of `router` destructuring for readability
mohitb35 Mar 21, 2024
2f6eedf
refactor: minor changes to routing/route comparison logic
mohitb35 Mar 21, 2024
189b669
Merge 'develop' to feature/migrate-nexti18next-to-nextintl
mohitb35 Mar 21, 2024
ed7dbfa
refactor: minor cleanup
mohitb35 Mar 21, 2024
7e61e41
fix: updates pluralized translation strings to include number
mohitb35 Mar 22, 2024
dcd6254
fix: resolves missing translation import warnings
mohitb35 Mar 22, 2024
f8d1b4b
refactor: delete unused translations
mohitb35 Mar 22, 2024
db0fe8a
🌐 Language update from LingoHub 🤖
lingohub[bot] Mar 22, 2024
642e0fa
feat: corrects share text
mohitb35 Mar 22, 2024
12fffee
fix: corrects add project description
mohitb35 Mar 22, 2024
3c75b3c
Merge pull request #2017 from Plant-for-the-Planet-org/lingohub_langu…
mohitb35 Mar 22, 2024
735ee19
fix: resolves issue (lang change on navigation)
mohitb35 Mar 26, 2024
b7c0b2a
feat: filters available locales based on tenant
mohitb35 Apr 2, 2024
f24ee4d
docs: add console logs to identify points of failure in middleware
mohitb35 Apr 2, 2024
048df3f
Merge branch 'develop' into feature/migrate-nexti18next-to-nextintl
mohitb35 Apr 3, 2024
df4afb1
Merge from 'develop' to feature/migrate-nexti18next-to-nextintl
mohitb35 Apr 4, 2024
9395ee9
fix: resolves locale mismatch while fetching projects
mohitb35 Apr 8, 2024
79f255d
Merge from 'develop' into feature/migrate-nexti18next-to-nextintl
mohitb35 Apr 15, 2024
cd5d55c
fix: replaces a.plant-for-the-planet links again
mohitb35 Apr 15, 2024
dd4c975
chore: updates package lock to fix build errors
mohitb35 Apr 15, 2024
3b24f7b
fix: resolves language switching bug on back button (single project)
mohitb35 Apr 15, 2024
a13b08f
fix: resolves blank map on switching language (project details pg)
mohitb35 Apr 16, 2024
b6abe89
fix: fixes issue (no site query string on first load of project detai…
mohitb35 Apr 16, 2024
b7714f3
fix: resolves caching issue after updating language
mohitb35 Apr 16, 2024
522ae94
fix: resolves language caching issue for back button click (single pr…
mohitb35 Apr 16, 2024
aac6bb4
fix: removes additional history item on language change
mohitb35 Apr 17, 2024
1fbc84a
fix: resolves cache issue for locale in project detail pages
mohitb35 Apr 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: resolves language caching issue for back button click (single pr…
…oject page)
mohitb35 committed Apr 16, 2024
commit 522ae94255d9310a68b164763742cd10f05343e2
5 changes: 3 additions & 2 deletions src/features/projects/screens/SingleProjectDetails.tsx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import ReactPlayer from 'react-player/lazy';
import ReadMoreReact from 'read-more-react';
import BackButton from '../../../../public/assets/images/icons/BackButton';
import ProjectContactDetails from '../components/projectDetails/ProjectContactDetails';
import { useTranslations } from 'next-intl';
import { useLocale, useTranslations } from 'next-intl';
import CancelIcon from '../../../../public/assets/images/icons/CancelIcon';
import ExpandIcon from '../../../../public/assets/images/icons/ExpandIcon';
import ProjectInfo from '../components/projectDetails/ProjectInfo';
@@ -36,6 +36,7 @@ function SingleProjectDetails(): ReactElement {

const tDonate = useTranslations('Donate');
const tMaps = useTranslations('Maps');
const locale = useLocale();
const {
project,
geoJson,
@@ -99,7 +100,7 @@ function SingleProjectDetails(): ReactElement {
window.history.go(-2);
} else {
router.replace({
pathname: '/',
pathname: `/${locale}`,
query: {
...(isEmbed ? { embed: 'true' } : {}),
...(isEmbed && callbackUrl !== undefined
Loading