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

fix: registerModule hook not working for js/ts format resources #2188

Merged

Conversation

BobbieGoede
Copy link
Collaborator

πŸ”— Linked issue

#2141

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

It seems that only locales within the project langDir were being resolved in the following line: https://github.com/nuxt-modules/i18n/blob/next/src/utils.ts#L62C1-L62C92

This results in locales added via the i18n:registerModule hook and possibly layers too would not get a type or types assigned to it, which as far as I understand is required for js/ts format locales (I'm still catching up with the changes made in the last few months πŸ˜…).

Note that my changes removes the file extension check/filter in the resolve function, I could add a basic matcher to ensure each file has the correct extension if needed.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@BobbieGoede BobbieGoede requested a review from kazupon June 30, 2023 09:48
@BobbieGoede BobbieGoede self-assigned this Jun 30, 2023
Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Good job!
Thank you! ❀️

@kazupon kazupon merged commit f80c3e9 into nuxt-modules:next Jun 30, 2023
8 checks passed
@jaydeep-stallion
Copy link

jaydeep-stallion commented Jul 20, 2023

I added i18n:registerModule hook in my index.ts module's file but its not translating the messages

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants