Vanilla JS Schnellstart

Wenn Sie die React- oder Next-Integrationsschichten nicht verwenden möchten, nutzen Sie direkt die Kern-Engine.

Installieren

bash
npm install @18ways/core

Grundübersetzung

ts
import { create18waysEngine } from '@18ways/core/engine';
 
const ways = create18waysEngine({
  apiKey: 'YOUR_18WAYS_PUBLIC_API_KEY',
  locale: 'fr-FR',
  baseLocale: 'en-GB',
  context: 'app',
});
 
const hello = await ways.t('Hello world');
ways.setLocale('de-DE');
const cta = await ways.t('Pay now', {
  context: 'checkout.button',
});

Von dort aus fügen Sie Variablen, Caching und Ihren eigenen Rendering-Flow auf der Nutzungsseite hinzu.

Nächster Schritt: Verwendung von Vanilla JS

Vanilla JS Quickstart