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

Support Request for nuxt-i18n-micro #1249

Open
Blackskyliner opened this issue Dec 12, 2024 · 1 comment
Open

Support Request for nuxt-i18n-micro #1249

Blackskyliner opened this issue Dec 12, 2024 · 1 comment

Comments

@Blackskyliner
Copy link

Blackskyliner commented Dec 12, 2024

What framework do you want to have? Please provide links of its i18n solution/package.
https://s00d.github.io/nuxt-i18n-micro/guide/getting-started

Please provide some overall screenshots about how the i18n usage would be like
General Vue analogue to vue-i18n usage.

Please provide a minimal starter project
https://github.com/Blackskyliner/nuxt-i18n-micro-example

Additional context

  • The Framework supports global translation keys like all other frameworks (e.G. locales/[language].json)
  • The Framework splits translations by pages (e.G. app/pages/PageA.vue has access to locales/pages/PageA/[language].json and global ones but not the ones for PageB)
  • The Framework allows for In-Component translations (see app/components/ComponentTranslation.vue in example repo)
@DenisNikonov
Copy link

Hi! Here is a custom configuration for i18n-ally that supports nuxt-i18n-micro until official support is added:

# .vscode/i18n-ally-custom-framework.yml

languageIds:
  - javascript
  - typescript
  - vue

usageMatchRegex:
  # Basic translations
  - "[^\\w\\d]\\$t\\(['\"`]({key})['\"`]"
  - "[^\\w\\d]t\\(['\"`]({key})['\"`]"
  # Pluralization
  - "[^\\w\\d]\\$tc\\(['\"`]({key})['\"`]"
  - "[^\\w\\d]tc\\(['\"`]({key})['\"`]"
  # Number formatting
  - "[^\\w\\d]\\$tn\\(['\"`]({key})['\"`]"
  - "[^\\w\\d]tn\\(['\"`]({key})['\"`]"
  # Date formatting
  - "[^\\w\\d]\\$td\\(['\"`]({key})['\"`]"
  - "[^\\w\\d]td\\(['\"`]({key})['\"`]"
  # Relative dates
  - "[^\\w\\d]\\$tdr\\(['\"`]({key})['\"`]"
  - "[^\\w\\d]tdr\\(['\"`]({key})['\"`]"
  # Components
  - "<i18n-t[^>]*keypath=['\"`]({key})['\"`]"
  - "<i18n-link[^>]*to=['\"`]({key})['\"`]"

localesPaths:
  - locales
  - locales/pages

fileExtensions:
  - json

monopoly: true

parsers:
  - JSON

This configuration supports:

  • Global and page-specific translations
  • All translation functions ($t, $tc, $tn, $td, $tdr)
  • i18n components
  • Component translations

Just create .vscode/i18n-ally-custom-framework.yml with this content and VSCode will detect it automatically

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

No branches or pull requests

2 participants