nyavro / i18nPlugin

Intellij idea i18next support plugin
MIT License
72 stars 12 forks source link

Don't know how to configure plugon #141

Open Akeuuh opened 2 years ago

Akeuuh commented 2 years ago

Hello, your plugin seems to be great but I'm not able to configure it...

Here is my i18n init function

` i18next.init({ // debug: true, whitelist: ['fr', 'en'], fallbackLng: 'fr', interpolation: { escapeValue: false, format: (value, f, lng) => { let format = f

  const formatKey = 'formats.' + format
  const i18nforma = i18next.t(formatKey)
  if (i18nforma !== formatKey) {
    format = i18nforma
  }

  // You can extends functionality here by providing custom format function based on value and format
  if (format && value instanceof Date) {
    const locale = locales[lng || fallbackLang]
    const s = dateFormat(value, format, { locale })
    return s
  }
  if (format === 'array_item') {
    return value.join(', ')
  }
  return value
},

}, resources, })`

Here is my architecture and configuration

Capture d’écran, le 2022-01-14 à 07 53 26 Capture d’écran, le 2022-01-14 à 07 53 58

It is a React Native project with i18next.

See you

MaskedHawk commented 1 month ago

Same