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

Add Next.js Localization Framework #339

Open
DennisAlund opened this issue May 21, 2024 · 0 comments
Open

Add Next.js Localization Framework #339

DennisAlund opened this issue May 21, 2024 · 0 comments
Assignees
Labels
domain:i18n 💬 Things related to internationalization priority:low 🏖️ Low priority issue type:enhancement 😃 New feature or request

Comments

@DennisAlund
Copy link
Member

Description

Implement localization support for the Tanam web application using the Next.js localization framework. The localization should use two-letter language locales as a prefix to URLs and should initially support English (en) and Indonesian (in).

Requirements

  1. Locale Prefix for URLs

    • URLs should include the locale as a prefix.
    • Example:
      • English: https://example.com/en/some/path
      • Indonesian: https://example.com/in/some/path
  2. Supported Locales

    • English (default)
    • Indonesian
  3. Translation of Sidebar Navigation

    • Replace all presentation strings in the sidebar navigation with localized strings.
  4. URL-Based Language Change

    • Confirm that the language change works for the sidebar menu by changing the URL:
      • http://localhost:3000/en should display the sidebar menu in English.
      • http://localhost:3000/in should display the sidebar menu in Indonesian.

Steps to Implement

  1. Install Next.js Internationalized Routing

  2. Configure next.config.js
    Add the supported locales and set the default locale from

    1. Try to resolve/guess from request headers
    2. Fallback to default en
  3. Create Locale Files
    Create JSON files for English and Indonesian translations.

  4. Test the Implementation

    • Run the development server and navigate to the following URLs to ensure that the sidebar menu displays the correct language:
      • http://localhost:3000/en
      • http://localhost:3000/in

Additional Notes

  • Ensure to add more translations as needed for other parts of the application.
  • Consider adding a language switcher to the UI for user convenience.

References

@DennisAlund DennisAlund added type:enhancement 😃 New feature or request priority:low 🏖️ Low priority issue domain:i18n 💬 Things related to internationalization labels May 21, 2024
@DennisAlund DennisAlund moved this to Backlog in Tanam Jun 28, 2024
@DennisAlund DennisAlund removed the status in Tanam Jul 26, 2024
@DennisAlund DennisAlund moved this to Backlog in Tanam Jul 26, 2024
@muzanella11 muzanella11 self-assigned this Sep 26, 2024
@muzanella11 muzanella11 added this to the Add Localization milestone Sep 27, 2024
@muzanella11 muzanella11 moved this from Backlog to In progress in Tanam Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:i18n 💬 Things related to internationalization priority:low 🏖️ Low priority issue type:enhancement 😃 New feature or request
Projects
Status: In progress
Development

No branches or pull requests

3 participants