Documentation

Introduction to LocaleCloud

This documentation covers the latest version (v1.0.0) of LocaleCloud. For earlier versions, please refer to the legacy documentation.

LocaleCloud is an AI-powered localization service with a focus on developer experience. It makes integrating multi-language support into your applications simple and efficient.

What is LocaleCloud?

LocaleCloud provides an ergonomic API for translating your application's text content into multiple languages. Unlike traditional localization tools that require you to manually create translation files for each language, LocaleCloud leverages AI to automatically generate high-quality translations.

The core principle behind LocaleCloud is simplicity combined with performance. By using the t() function in your code, you mark text for translation through a powerful edge cache system and AI translation model. When t("something") is called, it first checks if there's a cache entry and immediately returns it if found. If there's no cache, the LLM model translates it on-demand.

New terms are typically registered during the development cycle, so in production, most translations load instantly from the edge cache. This cache contains every term used in your project, eliminating the need for additional fetching while users interact with your app.

Key Features

Simple API

A clean, intuitive function call that doubles as both a key and default value.

AI-Powered Translations

High-quality translations generated by advanced machine learning models.

Context Management

Add context information in the dashboard to improve translation accuracy.

Framework Agnostic

Works with any JavaScript framework or vanilla JS applications.

Basic Example

Here's a simple example of how to use LocaleCloud in your code:

// Import the LocaleCloud client
import { t, setLocale } from '@localecloud/client';

// Set the user's preferred language
setLocale('fr'); // For French

// Use the translation function in your code
const greeting = t("Hello, world!");
console.log(greeting); // Outputs: "Bonjour, le monde!"

// With variables
const message = t("Welcome back, {name}!", { name: "Alice" });
console.log(message); // Outputs: "Bon retour, Alice!"

Next Steps

Ready to get started with LocaleCloud? Here are the next steps:

  1. Install the LocaleCloud package in your project
  2. Follow the quickstart guide to set up your first translation
  3. Explore core concepts to understand how LocaleCloud works