Shipeasy
ReferenceJava

Internationalization (i18n)

The Java SDK is a server SDK and does not expose a t() / label-render helper. Translated strings are rendered in the browser, by the Shipeasy client SDK.…

Generated from the SDK's own /docs/ — also served raw at https://shipeasy-ai.github.io/sdk-java/pages/i18n.md.

The Java SDK is a server SDK and does not expose a t() / label-render helper. Translated strings are rendered in the browser, by the Shipeasy client SDK. There is no getLabel, renderLabel, or in-process string lookup in this package.

What the Java SDK does provide is the SSR bootstrap tags that wire the browser loader so the client SDK has its translations on first paint. They are package-level statics on Shipeasy, resolving the engine that configure() built — you never name an engine.

The cross-SDK i18n story

  1. The Java server emits the i18n loader <script> tag into the document <head> via Shipeasy.i18nScriptTag(clientKey, profile).
  2. The static /sdk/i18n/loader.js loader fetches translations for the {{PROFILE}} profile (e.g. en:prod) from the CDN, using the public client key (safe to embed in HTML — never the server key).
  3. The browser client SDK's t() renders the keys against the loaded strings.

Emitting the loader tag

import ai.shipeasy.Shipeasy;

// The PUBLIC client key (not the server key) goes on the i18n loader tag.
String clientKey = System.getenv("SHIPEASY_CLIENT_KEY");
String head = Shipeasy.i18nScriptTag(clientKey, "{{PROFILE}}");
// → place `head` inside your document <head>

Overloads:

  • Shipeasy.i18nScriptTag(clientKey, profile) — default CDN base (https://cdn.shipeasy.ai).
  • Shipeasy.i18nScriptTag(clientKey, profile, baseUrl) — override the CDN base.

You typically emit it alongside the flags bootstrap tag (see Advanced → SSR):

import ai.shipeasy.Shipeasy;
import java.util.Map;

Map<String, Object> user = Map.of("user_id", "u_123");
String head = Shipeasy.bootstrapScriptTag(user)
            + Shipeasy.i18nScriptTag(clientKey, "{{PROFILE}}");

Profiles

A profile is locale:env, e.g. en:prod, fr:prod. Pass the desired profile as the second argument; an empty/null profile defaults to en:prod.

The actual translation lookup (t("key")) is client-side only — see the browser/client SDK docs.

Was this page helpful?
✎ Edit this page

On this page