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

Added an option of using the <Interpolate /> with a raw HTML #195

Merged
merged 3 commits into from Aug 10, 2016

Conversation

@KostyaEsmukov
Copy link
Contributor

KostyaEsmukov commented Jul 31, 2016

Discussion in #189

Usage:

<Interpolate i18nKey='foo' useDangerouslySetInnerHTML={true} />

TODO:

  • Tests? I'm not sure how to properly test a component, see my comment at #193
  • Generate dist files
…lation values. See #189
@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Jul 31, 2016

did you init i18next before using it?

@KostyaEsmukov

This comment has been minimized.

Copy link
Contributor Author

KostyaEsmukov commented Jul 31, 2016

In my own project? Yes I did, and it works as is. Why do you ask?

In case you need my config, here it is:

import * as i18n from 'i18next';
import * as LanguageDetector from 'i18next-browser-languagedetector';

import { ru } from './ru';

i18n
  .use(LanguageDetector)
  .init({
    fallbackLng: 'ru',
    whitelist: ['ru'],

    debug: ENV !== 'production',

    interpolation: {
      prefix: '__',
      suffix: '__',
      escapeValue: false  // not needed for react!!
    },
    joinArrays: '\n',
    resources: {
      ru: {
        translation: ru
      }
    }
  });
@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Jul 31, 2016

sorry landed on wrong PR...did reply on phone while on holiday network...seems mail reply mixed it up...will review PR after holiday.

@jamuhl jamuhl merged commit 3bf8209 into i18next:master Aug 10, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Aug 10, 2016

published react-i18next@1.7.0. thanks for providing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.