feat: add internationalization (i18n) support#4
Draft
agmmtoo wants to merge 1 commit into
Draft
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor to support full localization (i18n) for all main pages, including authentication and static content, by moving them into locale-aware routes and updating their logic to use localized dictionaries and metadata. Additionally, it updates global styles to better support the Burmese (
my) language and improves font handling. Several files are removed or replaced with redirects to their new locale-aware counterparts.Key changes include:
1. Localization and Routing Overhaul
All primary pages (home, login, signup, forgot password, about, privacy, terms) are now under
[locale]routes, ensuring content is served in the user's language. Each page fetches the appropriate dictionary and metadata, and validates the locale parameter, returning a 404 for unsupported locales. ([app/[locale]/about/page.tsxR1-R69](https://github.com/librarease/librarease-web/pull/4/files#diff-3cf1637e12640a713bc585a37db4f0fad043105a89138c11d7e00fc16e1438c0R1-R69),[app/[locale]/login/page.tsxR1-R57](https://github.com/librarease/librarease-web/pull/4/files#diff-e35ce5e673be0d78de730bba03682a66aeff2d88a93fd984367d5765ae75235eR1-R57),[app/[locale]/signup/page.tsxR1-R47](https://github.com/librarease/librarease-web/pull/4/files#diff-309e05448c1c8dae3069d1f20405a3eb862e8bcb7dad78210ec712e63539a289R1-R47),[app/[locale]/forgot-password/page.tsxR1-R62](https://github.com/librarease/librarease-web/pull/4/files#diff-01253247ebeb29f70142e00ad54c654f7ca457586f5a03c05f9bffeb84d19947R1-R62),[app/[locale]/page.tsxR1-R119](https://github.com/librarease/librarease-web/pull/4/files#diff-6fbfba030614a776ef872a9fd818b8312fecd33e7054d62bd6ba952160fa764aR1-R119),[app/[locale]/layout.tsxR1-R25](https://github.com/librarease/librarease-web/pull/4/files#diff-44ca66e460fac15e804a2ab56f6038ef2dd0a231881294f0a3895f9ad7624c58R1-R25),[app/[locale]/privacy/page.tsxL1-R53](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL1-R53),[app/[locale]/terms/page.tsxL1-R50](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L1-R50))The root
layout.tsxnow determines the user's locale from request headers and sets the HTMLlangattribute accordingly, defaulting to English if not present or invalid. ([[1]](https://github.com/librarease/librarease-web/pull/4/files#diff-eca96d2c09f31517696a26e1d0be4070e1fbab02831481bed006e275741d030bR10-R16),[[2]](https://github.com/librarease/librarease-web/pull/4/files#diff-eca96d2c09f31517696a26e1d0be4070e1fbab02831481bed006e275741d030bL63-R76))2. Authentication Page Refactoring
/login,/signup,/forgot-password) are replaced with redirect components that forward users to their/en/equivalents, ensuring all authentication flows are now localized. ([[1]](https://github.com/librarease/librarease-web/pull/4/files#diff-87bb40e63a4105a08e29f7d5602a447e94a68619080a086bc510bcac0cba6932L1-R4),[[2]](https://github.com/librarease/librarease-web/pull/4/files#diff-6573984fa57dc7e4e1fddb3716bbca8e1888c0af157bbe6db5118d8ef8e320ddL1-R4),[[3]](https://github.com/librarease/librarease-web/pull/4/files#diff-19602c9fa5f8bd13b3adb9b8ebfa6071c2c16723a8117940c22a53fc5f0091cdL1-R4))3. Static Content Localization
[locale]routes, now rendering content from the localized dictionary instead of static API docs, and their navigation and headings are localized. ([app/[locale]/privacy/page.tsxL1-R53](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL1-R53),[app/[locale]/privacy/page.tsxL33-R67](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL33-R67),[app/[locale]/terms/page.tsxL1-R50](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L1-R50),[app/[locale]/terms/page.tsxL34-R67](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L34-R67))4. Global Styles and Font Improvements
my) to improve readability and appearance for that language. ([[1]](https://github.com/librarease/librarease-web/pull/4/files#diff-79e0914d9fee5ca4432bdb002a24d700d31b5577265f4de3f90d5c292b9f1392L73-R77),[[2]](https://github.com/librarease/librarease-web/pull/4/files#diff-79e0914d9fee5ca4432bdb002a24d700d31b5577265f4de3f90d5c292b9f1392R145-R172))5. Component and Metadata Enhancements
[app/[locale]/about/page.tsxR1-R69](https://github.com/librarease/librarease-web/pull/4/files#diff-3cf1637e12640a713bc585a37db4f0fad043105a89138c11d7e00fc16e1438c0R1-R69),[app/[locale]/login/page.tsxR1-R57](https://github.com/librarease/librarease-web/pull/4/files#diff-e35ce5e673be0d78de730bba03682a66aeff2d88a93fd984367d5765ae75235eR1-R57),[app/[locale]/signup/page.tsxR1-R47](https://github.com/librarease/librarease-web/pull/4/files#diff-309e05448c1c8dae3069d1f20405a3eb862e8bcb7dad78210ec712e63539a289R1-R47),[app/[locale]/forgot-password/page.tsxR1-R62](https://github.com/librarease/librarease-web/pull/4/files#diff-01253247ebeb29f70142e00ad54c654f7ca457586f5a03c05f9bffeb84d19947R1-R62),[app/[locale]/page.tsxR1-R119](https://github.com/librarease/librarease-web/pull/4/files#diff-6fbfba030614a776ef872a9fd818b8312fecd33e7054d62bd6ba952160fa764aR1-R119))This refactor sets the foundation for a fully multilingual user experience and ensures that all user-facing routes and content are properly localized and accessible.
References:
Localization and Routing: (
[app/[locale]/about/page.tsxR1-R69](https://github.com/librarease/librarease-web/pull/4/files#diff-3cf1637e12640a713bc585a37db4f0fad043105a89138c11d7e00fc16e1438c0R1-R69),[app/[locale]/login/page.tsxR1-R57](https://github.com/librarease/librarease-web/pull/4/files#diff-e35ce5e673be0d78de730bba03682a66aeff2d88a93fd984367d5765ae75235eR1-R57),[app/[locale]/signup/page.tsxR1-R47](https://github.com/librarease/librarease-web/pull/4/files#diff-309e05448c1c8dae3069d1f20405a3eb862e8bcb7dad78210ec712e63539a289R1-R47),[app/[locale]/forgot-password/page.tsxR1-R62](https://github.com/librarease/librarease-web/pull/4/files#diff-01253247ebeb29f70142e00ad54c654f7ca457586f5a03c05f9bffeb84d19947R1-R62),[app/[locale]/page.tsxR1-R119](https://github.com/librarease/librarease-web/pull/4/files#diff-6fbfba030614a776ef872a9fd818b8312fecd33e7054d62bd6ba952160fa764aR1-R119),[app/[locale]/layout.tsxR1-R25](https://github.com/librarease/librarease-web/pull/4/files#diff-44ca66e460fac15e804a2ab56f6038ef2dd0a231881294f0a3895f9ad7624c58R1-R25),[app/[locale]/privacy/page.tsxL1-R53](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL1-R53),[app/[locale]/terms/page.tsxL1-R50](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L1-R50))Auth Redirects: (
[[1]](https://github.com/librarease/librarease-web/pull/4/files#diff-87bb40e63a4105a08e29f7d5602a447e94a68619080a086bc510bcac0cba6932L1-R4),[[2]](https://github.com/librarease/librarease-web/pull/4/files#diff-6573984fa57dc7e4e1fddb3716bbca8e1888c0af157bbe6db5118d8ef8e320ddL1-R4),[[3]](https://github.com/librarease/librarease-web/pull/4/files#diff-19602c9fa5f8bd13b3adb9b8ebfa6071c2c16723a8117940c22a53fc5f0091cdL1-R4))Static Content Localization: (
[app/[locale]/privacy/page.tsxL1-R53](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL1-R53),[app/[locale]/privacy/page.tsxL33-R67](https://github.com/librarease/librarease-web/pull/4/files#diff-1ceb52b4acf1b841c48d352a3f07e293ad938f6b8f7939a0bbc68826ac2079cbL33-R67),[app/[locale]/terms/page.tsxL1-R50](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L1-R50),[app/[locale]/terms/page.tsxL34-R67](https://github.com/librarease/librarease-web/pull/4/files#diff-3ca173940553dd2d1c7373fc44d5ec9562da8e79aeffdd80e9df5e4b06e808d7L34-R67))Global Styles: (
[[1]](https://github.com/librarease/librarease-web/pull/4/files#diff-79e0914d9fee5ca4432bdb002a24d700d31b5577265f4de3f90d5c292b9f1392L73-R77),[[2]](https://github.com/librarease/librarease-web/pull/4/files#diff-79e0914d9fee5ca4432bdb002a24d700d31b5577265f4de3f90d5c292b9f1392R145-R172))Metadata Enhancements: (
[app/[locale]/about/page.tsxR1-R69](https://github.com/librarease/librarease-web/pull/4/files#diff-3cf1637e12640a713bc585a37db4f0fad043105a89138c11d7e00fc16e1438c0R1-R69),[app/[locale]/login/page.tsxR1-R57](https://github.com/librarease/librarease-web/pull/4/files#diff-e35ce5e673be0d78de730bba03682a66aeff2d88a93fd984367d5765ae75235eR1-R57),[app/[locale]/signup/page.tsxR1-R47](https://github.com/librarease/librarease-web/pull/4/files#diff-309e05448c1c8dae3069d1f20405a3eb862e8bcb7dad78210ec712e63539a289R1-R47),[app/[locale]/forgot-password/page.tsxR1-R62](https://github.com/librarease/librarease-web/pull/4/files#diff-01253247ebeb29f70142e00ad54c654f7ca457586f5a03c05f9bffeb84d19947R1-R62),[app/[locale]/page.tsxR1-R119](https://github.com/librarease/librarease-web/pull/4/files#diff-6fbfba030614a776ef872a9fd818b8312fecd33e7054d62bd6ba952160fa764aR1-R119))