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

feat(lang): Add multiple languages configuration #26

Conversation

hoangnt2
Copy link
Contributor

@hoangnt2 hoangnt2 commented May 8, 2023

Refer issue: #25

Some changes

  • Add multiple languages configuration (use next-i18next):

    • Apply multiple languages on login page
    • Add language switcher on login page (click on the flags)

    Login page with English language
    image

    Login page with Japanese language
    image

  • Move login page from /auth to /

  • Move home page from / to /home

  • Remove unnecessary component: PublicContextProvider

  • Change Environment variable from SW360_API_URL to NEXT_PUBLIC_SW360_API_URL (can be used on client side)

How to test

Prerequisite

  • create .env file at root folder:
   NEXTAUTH_SECRET='secret'
   NEXT_PUBLIC_SW360_API_URL='http://localhost:8080'
  • Add 2 lines to /etc/sw360/sw360.properties and create OAuthClient (Access to Admin page and create at least one OAutClient) to use login function:
   rest.apitoken.generator.enable = true
   sw360.liferay.company.id=20099

Procedures

Result

  • language will be change

@hoangnt2 hoangnt2 force-pushed the release/add-multiple-language-configuration branch from defc86d to 182182f Compare May 8, 2023 04:26
@hoangnt2
Copy link
Contributor Author

hoangnt2 commented May 8, 2023

Hi @heliocastro,
The header cannot be added to language files (common.json). Could you ignore them when checking files's license?

@heliocastro
Copy link
Contributor

heliocastro commented May 8, 2023

Yes, you add the exception on the .licencerc.yaml config file. Please add common.json there

@hoangnt2 hoangnt2 force-pushed the release/add-multiple-language-configuration branch 2 times, most recently from 7b98439 to a4a1de6 Compare May 8, 2023 05:30
@hoangnt2
Copy link
Contributor Author

hoangnt2 commented May 8, 2023

Yes, you add the exception on the .licencerc.yaml config file. Please add common.json there

Thanks. But in my opinion, we should keep package-lock.json in our repository. It's recommended.

Copy link
Contributor

@heliocastro heliocastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good to go.

@hoangnt2 How complicated is to change the current code to new APP router ?
The ends result will simplify more the code.
Here's the reference
Is likely a future proof update.

If you think is too difficult to do it now, just update the CONTRIBUTORS.md

src/utils/env.ts Show resolved Hide resolved
@hoangnt2 hoangnt2 force-pushed the release/add-multiple-language-configuration branch from a4a1de6 to 48b0ec9 Compare May 8, 2023 08:03
@hoangnt2
Copy link
Contributor Author

hoangnt2 commented May 8, 2023

@heliocastro, I think it's not easy to change to App router now. I will research your reference and try to do it later.

@heliocastro heliocastro requested review from heliocastro May 8, 2023 08:16
Copy link
Contributor

@heliocastro heliocastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go

@heliocastro heliocastro merged commit 66964c8 into eclipse-sw360:main May 8, 2023
@hoangnt2 hoangnt2 deleted the release/add-multiple-language-configuration branch January 4, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants