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

Why use a separate locale package? #4

Closed
dBianchii opened this issue Apr 2, 2024 · 2 comments
Closed

Why use a separate locale package? #4

dBianchii opened this issue Apr 2, 2024 · 2 comments

Comments

@dBianchii
Copy link
Collaborator

Hi @noxify . Thanks for this project. I used it as a reference while adding next-international to my current t3 turbo project.

I have one question: why separate locales into another package? Is it so that it can be used in other nextjs projects at the same time? Or only for organizational reasons?

Thanks for this! I had not heard of i18n ally before. Looks awesome!

@dBianchii dBianchii changed the title Why use a Why use a separate locale folder? Apr 2, 2024
@dBianchii dBianchii changed the title Why use a separate locale folder? Why use a separate locale package? Apr 2, 2024
@noxify
Copy link
Owner

noxify commented Apr 22, 2024

Hi @dBianchii,

soo sorry for the late reply.

Is it so that it can be used in other nextjs projects at the same time?

  • Yeah, could be a possible use case for this - Having some shared translation ( e.g. Save, Update ), but would work only if you plan to use generic translation ( e.g. Create instead of Create Task )

Or only for organizational reasons?

Tbh, I can't remember why I did it as separate package - possible that it's just over-engineered :D
If I'm not wrong, I had to use a "custom source" configuration for i18n ally ( and read the JSON files), otherwise I got only a "blank screen".

I think you can implement the localization directly in the app, if you don't need the i18n ally extension - But with the current implementation I would keep it in a separate package, otherwise you have to add the lang:gen command in each app ( or use something else which generates the ts files.


Hope that makes sense, haven't checked the code and/or if it's now possible to read the ts files directly / using the next-international configuration from i18n ally.

@noxify
Copy link
Owner

noxify commented May 16, 2024

As mentioned in #6 it seems that we could read the ts files directly, but they are read-only.
I assumed it's based on the "nested structure", but got the same result with a "flat structure".

I think using the json files is currently the "way to go" if you want to use the Editor UI from i18n-ally.

I have seen that there are some issues/PRs in their repo.

Will close this issue for now - if there is something else, please let know :)

@noxify noxify closed this as completed May 16, 2024
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

No branches or pull requests

2 participants