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

Don't know how to configure plugon #141

Open
Akeuuh opened this issue Jan 14, 2022 · 0 comments
Open

Don't know how to configure plugon #141

Akeuuh opened this issue Jan 14, 2022 · 0 comments

Comments

@Akeuuh
Copy link

Akeuuh commented Jan 14, 2022

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

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

No branches or pull requests

1 participant