Skip to content
Start now

Help

Other websites and Shopify

Your developers integrate the SDK into a Node.js build or server and set up the language URLs.

WordPress: plugin

Plugin
  1. Your server sends the visible text to the NabuLingo service
  2. The translation is stored in your WordPress database
  3. Visitors get the finished page in their language

SDK for custom websites

Node.js
  1. Write to us
  2. Integrate the SDK
  3. Check language pages

SDK for custom websites

We set up custom websites on request, together with you. Write to us and we will activate your website. The download and the example below are for testing.

Send a request by email

Download SDK 0.1.5

Open your account

  1. Once we have set up your website with you, you will have your website key and Site ID. Transfer both to the protected environment of your Node.js build or server.
  2. Download the archive and install it in your project. The included README.md and NATIVE-SEO.md describe how to connect your templates. The example below prepares the full catalog for one English page and its German variant.
  3. List the public pages and their translated paths in your project. Keep the original URL and choose an explicit path for each language, such as /de/ueber-uns. Leave account pages, personalized content and checkout out of the catalog.
  4. Prepare confirmed catalogs on the server. Store catalogs and credentials in protected storage. If any entry is missing or unconfirmed, keep your current release in place. The example stops the build before handing pages to the renderer.
  5. Render HTML and metadata from the same validated page list. Check that the preview serves the actual language URLs, sets the right page language, uses self-referencing canonicals and reciprocal hreflang, and includes the right URLs in its sitemap before deploying.

npm install ./nabulingo-translate-0.1.5.tgz

SHA-256 273c221c4ec68b2a2b83f307f8af680f7e863a9da903f60be3ea5e5912b0f99e

Example for a protected Node.js build

Set NABULINGO_SITE_TOKEN and NABULINGO_SITE_ID in your secret manager. Save the example as prepare-catalogs.mjs and run it with a supported Node.js LTS release.

import { join } from "node:path";
import {
  createNabuLingoProvider, readLocaleFile, resolveConfig, runTranslate, writeSourceIndex,
} from "@nabulingo/translate";
import { createSeoSite } from "@nabulingo/translate/seo";

const siteToken = process.env.NABULINGO_SITE_TOKEN;
const siteId = process.env.NABULINGO_SITE_ID;
if (!siteToken || !siteId) throw new Error("Missing NabuLingo build credentials");

const routes = createSeoSite({
  origin: "https://example.com",
  siteName: "Example",
  sourceLocale: "en",
  locales: { de: { name: "German" }, en: { name: "English" } },
  pages: [{
    id: "about",
    paths: { de: "/de/ueber-uns", en: "/about" },
    indexable: true,
    title: "About us",
    description: "We make ceramics.",
    content: { heading: "About us", summary: "We make ceramics." },
    image: { path: "/images/ceramics.jpg", alt: "Ceramics", width: 1200, height: 630 },
  }],
});

const providerConfig = { type: "nabulingo", siteToken, siteId, requireConfirmed: true };
const provider = createNabuLingoProvider(providerConfig);
const catalogs = {};
for (const locale of routes.targetLocales) {
  const messagesDir = join("private-catalogs", locale);
  await writeSourceIndex(messagesDir, routes.sourceIndex(locale));
  const config = resolveConfig({
    sourceLocale: routes.sourceLocale, locales: [locale], provider: providerConfig, messagesDir,
  });
  const summary = await runTranslate(config, provider, { preserveReviewed: true });
  if (summary.some(({ errors }) => errors.length)) throw new Error("Catalog preparation failed");
  catalogs[locale] = await readLocaleFile(messagesDir, locale);
}
export const published = routes.build({ catalogs, siteId });

Use published.pages to generate output and published.match(pathname) to resolve requests. Use renderSeoHead(page) and renderSitemap(published.pages) from the SEO entry point. Set page.lang and page.dir on the HTML document, build language links from page.versions and use your template engine’s usual HTML escaping.

Language switcher for your translated pages

Download the NabuLingo language switcher

SHA-256 ed413354bba71b9ab8e7b4851d19a1e38efd436b3b8c36bfb5afeaccc30cced9

Download the language switcher and save it as /assets/widget.js on your site. Include the script on each language version. Set data-source to the current page language, list the other languages in data-langs, and include every language path for that page in data-routes. Use paths on your own site.

<script src="/assets/widget.js" defer
  data-mode="routes" data-source="en" data-langs="de"
  data-routes='{"en":"/about","de":"/de/ueber-uns"}'
  data-label="Language"></script>

If your Content Security Policy restricts rendering, allow data: in img-src for the flags. The widget adds a style element. Use the same per-response nonce on the script tag and in the applicable style-src-elem or style-src directive.

Websites without WordPress

How do I use NabuLingo with Shopify?

Install the free NabuLingo app from the Shopify App Store and switch on the language switcher in the theme editor. The app translates the visible text in your visitors’ browser: one language, 5,000 words a month. Search engines do not see these translations, and the checkout is not translated.

Still stuck?

Write to us by email.

Please include your website address and the message you see, word for word.

Please do not send your website key by email.

Open your email programhello@nabulingo.com

This opens your own email program. Nothing is sent from this page.

No plan yet? Fixed price per website, from €9 a month (net). See plans and prices