Skip to content

Conversation

@userquin
Copy link
Contributor

@userquin userquin commented Jan 28, 2026

This PR includes:

  • moves i18n configuration to config folder
  • adds support for multiple json files (country variants)
  • allows configure rtl, numberFormats, dateTimeFormats and pluralRule
  • setups initial language from local storage (added to the settings, you may need to clear npmx-settings entry + page refresh) via client plugin => now language is restored on page refrresh
  • restores stored language from local storage: changed setting page to just bind the settings.language
  • added some composables and helpers functions: counting kilo/mega for example (intl compact style => check i18n composable, we may need to add some missing entries if required => time ago for example)
  • included isHydrated and wrapI18n hack at elk.zone
  • added script to prepare translation json files for lunaria

I have left the same languages used at elk.zone, keeping just the current used here.

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Jan 28, 2026 11:25pm
npmx-lunaria Error Error Jan 28, 2026 11:25pm
npmx.dev Ready Ready Preview, Comment Jan 28, 2026 11:25pm

Request Review

# Conflicts:
#	package.json
#	pnpm-lock.yaml
@userquin userquin marked this pull request as draft January 28, 2026 17:42
@userquin
Copy link
Contributor Author

I'm going to resolve conflicts and merge messages for lunaria 🤞

Copy link
Contributor

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

LGTM! Lunaria workaround makes sense to me. Just pointing out that since we are not tracking the real files the Action won't show up in PRs, but since it's just temporary till I add the feature inside Lunaria it won't be a problem.

I would maybe make so lunaria-json-files are lunaria/files or something so everything concerning Lunaria outside config is in the same folder, but definitely not blocking.

@userquin
Copy link
Contributor Author

userquin commented Jan 28, 2026

I would maybe make so lunaria-json-files are lunaria/files or something so everything concerning Lunaria outside config is in the same folder, but definitely not blocking.

I added that folder to .gitignore then removed, we can generate json files inside the lunaria/files folder 👍

const { t, d, n, ...rest } = useOriginalI18n()
const i18n = useOriginalI18n()

const { t, d, n, ...rest } = i18n
Copy link
Contributor Author

Choose a reason for hiding this comment

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

argg, undo this

@userquin
Copy link
Contributor Author

I'm going to split this PR to include i18n configuration and handle hydration missmatch issues.

@skaldebane
Copy link

storing the language in local storage works but it means there's always a flash of english UI before the js kicks in
using a cookie would solve this, as it would be rendered in the correct language on the server

this is what i usually use in sveltekit, could take a stab at it, tho i'm not super familiar with nuxt just yet :P

@skaldebane skaldebane mentioned this pull request Jan 29, 2026
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.

3 participants