Skip to content

feat(locale): add Hungarian language #3129

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

Merged

Conversation

nandordudas
Copy link
Contributor

magyar πŸ‡­πŸ‡Ί

πŸ”— Linked issue

❓ 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)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

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

@nandordudas
Copy link
Contributor Author

I'd like to propose implementing linked messages for commonly reused text across our localization files. This approach would help us maintain consistency and reduce duplication in our translations.

For example, instead of repeating the same close translation across different components, we could define it once in a common section and reference it using Vue i18n's linking syntax:

import { defineLocale } from '../composables/defineLocale'

export default defineLocale({
  name: '...',
  code: '...',
  messages: {
    common: {
      actions: {
        close: '...', // Define the translation once
      },
    },
    toast: {
      close: '@:common.actions.close', // Reference the common translation
    },
  }
})

This pattern would make our localization more maintainable since we'd only need to update common phrases in one place. It would also help ensure consistent terminology throughout the interface.

What are your thoughts on adopting this approach?

Copy link

pkg-pr-new bot commented Jan 17, 2025

npm i https://pkg.pr.new/@nuxt/ui@3129

commit: c8b45c2

@nandordudas
Copy link
Contributor Author

I noticed that Hungarian, like many languages, has multiple ICU locale definitions - both a general language code (hu) and a region-specific variant (hu-HU). Each of these has slightly different formatting rules for things like dates, numbers, and currency.

For example, looking at the ICU data:

  • hu: General Hungarian language settings
  • hu-HU: Hungary-specific formatting rules

Should we consider supporting these regional variants in our localization system? While starting with the base language code (hu) covers most cases, we might miss some region-specific formatting nuances. Would implementing just the base language locale be sufficient for our needs, or should we plan to support regional variants as well?

References:

@benjamincanac benjamincanac changed the title feat(i18n): add Hungarian language support feat(locale): add Hungarian language Jan 17, 2025
@nandordudas nandordudas force-pushed the feat-add-language-support-hungarian branch from 3f539c3 to 0714305 Compare January 19, 2025 06:31
@benjamincanac benjamincanac added the v3 #1289 label Jan 20, 2025
@nandordudas nandordudas force-pushed the feat-add-language-support-hungarian branch from 0714305 to c3ea8a5 Compare January 21, 2025 08:15
magyar πŸ‡­πŸ‡Ί
@benjamincanac
Copy link
Member

Thanks for your PR! 😊

Regarding the common messages, I don't think its necessary as there are very few entries. It would make the logic too complex for such a small improvement in my opinion.

I'm not sure it's necessary to support all regional variants, if you look at https://ui3.nuxt.dev/getting-started/i18n/nuxt#supported-languages we can see that only variants for different countries have been implemented but I don't know much about other countries needs for locales 😬

Let's merge this and if it's needed someday, we can make another PR!

@benjamincanac benjamincanac merged commit 891ba1f into nuxt:v3 Jan 24, 2025
2 checks passed
@nandordudas nandordudas deleted the feat-add-language-support-hungarian branch January 25, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 #1289
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants