# API

# PhraseInContextEditorPostProcessor

The PhraseInContextEditorPostProcessor class is the main point of the i18next Phrase In-Context Editor Post Processor library and the only place where Phrase (opens new window)-specific logic happens. Implements PostProcessor i18n type (opens new window).

# Constructor

constructor( options: PhraseInContextEditorOptions )

TIP

options argument is assigned to the component using config setter

# Properties

  • # config: PhraseConfig

  • # phraseEnabled: boolean - property controlling the status of the In-Context Editor. Propagates the change to globalThis.PHRASEAPP_ENABLED.

# Methods

  • interpolateKey( key: string, ): string[]

  • process( value: string, keys: string[], options: unknown, translator: unknown, ): string

WARNING

If the In-Context Editor is not yet loaded, changing phraseEnabled to true will trigger loading of the minified js source of the In-Context Editor.

TIP

Whenever disabled, the i18next Phrase In-Context Editor Post Processor will stop interpolating keys - this will revert back to the regular i18next (opens new window) behavior. For more information on how the formatters are being handled, please head to the introduction.

# PhraseInContextEditorOptions

Partial type of the PhraseConfig with only 2 properties required: phraseEnabled and projectId.

# PhraseConfig

Type describing all possible Phrase In-Context Editor config options.

phraseEnabled: boolean;
baseUrl: string;
profileUrl: string;
apiBaseUrl: string;
oauthEndpointUrl: string;
helpUrl: string;
logoUrl: string;
stylesheetUrl: string;
version: string;
priorityLocales: string[];
projectId: string;
branch: string;
ajaxObserver: boolean;
debugMode: boolean;
prefix: string; // default: '{{__'
suffix: string; // default: '__}}'
autoLowercase: boolean;
forceLocale: boolean;
loginDialogMessage: string;
useOldICE: boolean;
autoLogin: {
    perform: boolean;
    email: string;
    password: string;
};
sso: {
    enabled: boolean;
    enforced: boolean;
    provider: string;
    identifier: string;
};
fullReparse: boolean // default: true;
origin: string;
hidingClasses: string[]; // default: ['hidden', 'visuallyhidden', 'invisible'];