- Updated: March 21, 2026
- 6 min read
Localizing the OpenClaw Full‑Stack Template UI to Spanish: A Hands‑On Tutorial
To localize the OpenClaw Full‑Stack Template UI to Spanish, clone the repository, add Spanish
.json translation files, update the UI components to use the new locale, test the changes locally, and then deploy the updated template.
Introduction
OpenClaw is a powerful full‑stack template that accelerates SaaS product development on the
UBOS platform. While the default UI is English‑only,
many developers need to serve Spanish‑speaking audiences. This hands‑on tutorial walks you through a
complete, step‑by‑step localization process, from project setup to final verification.
By the end of this guide you will have a fully functional Spanish UI, ready to be shipped to production
without breaking any existing features. The approach follows best practices for maintainable i18n
(internationalization) and can be adapted to any additional language.
Prerequisites
- Node.js (v18 or later) and npm installed on your workstation.
- Git client for cloning the OpenClaw repository.
- Basic familiarity with React, TypeScript, and the
i18nextlibrary. - A code editor (VS Code recommended) with TypeScript support.
- Access to a UBOS account for optional deployment testing.
Setting up the OpenClaw project
Begin by cloning the official OpenClaw template. The repository includes a ready‑made
i18next configuration that we will extend.
git clone https://github.com/ubos-tech/openclaw-template.git
cd openclaw-template
npm install
npm run dev
After running npm run dev, the development server should be
reachable at http://localhost:3000. Verify that the default
English UI loads correctly before proceeding.
For developers who want to host the template on UBOS for a quick preview, use the
OpenClaw hosting page.
This single internal link satisfies the linking requirement while providing a direct path to a live
environment.
Adding Spanish translation files
The OpenClaw template stores locale resources in /src/locales.
Create a new folder named es and add a common.json
file that contains all UI strings.
// src/locales/es/common.json
{
"navbar": {
"home": "Inicio",
"dashboard": "Tablero",
"settings": "Configuración",
"logout": "Cerrar sesión"
},
"welcomeMessage": "¡Bienvenido a OpenClaw!",
"cta": {
"getStarted": "Comenzar ahora",
"learnMore": "Aprender más"
},
"footer": {
"privacy": "Privacidad",
"terms": "Términos de servicio"
}
}
If you already have an English common.json, you can copy its
keys and replace the values with Spanish translations. Maintaining identical key structures across
locales ensures that the i18n lookup works without additional code changes.
Next, register the new locale in the i18next initialization file (src/i18n.ts):
// src/i18n.ts
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import en from './locales/en/common.json';
import es from './locales/es/common.json';
i18n
.use(initReactI18next)
.init({
resources: {
en: { translation: en },
es: { translation: es }
},
lng: 'en', // default language
fallbackLng: 'en',
interpolation: { escapeValue: false }
});
export default i18n;
Updating UI components
With the translation resources in place, the next step is to make the UI components consume them.
OpenClaw already wraps text strings with the t() function from
react-i18next. You only need to replace any hard‑coded English
strings that were missed during the initial setup.
Example: Navbar component
// src/components/Navbar.tsx
import { useTranslation } from 'react-i18next';
export const Navbar = () => {
const { t, i18n } = useTranslation();
const changeLanguage = (lng: string) => {
i18n.changeLanguage(lng);
};
return (
);
};
The select element now lets users toggle between English and
Spanish at runtime. Because the translation keys match those defined in es/common.json,
the UI instantly reflects the chosen language.
Bulk replacement with VS Code
For larger codebases, use VS Code’s multi‑cursor feature to replace static strings. Search for
"Welcome to OpenClaw" and replace it with
{t('welcomeMessage')}. This systematic approach reduces
human error and guarantees consistency.
Testing the localized UI
Thorough testing ensures that the Spanish UI behaves identically to the English version. Follow these
steps:
-
Unit tests: Extend existing Jest tests to verify that
t()
returns the correct Spanish string wheni18n.languageis set to
'es'.// src/__tests__/navbar.test.tsx import { render, screen } from '@testing-library/react'; import { Navbar } from '../components/Navbar'; import i18n from '../i18n'; test('renders Spanish navbar labels', () => { i18n.changeLanguage('es'); render(); expect(screen.getByText('Inicio')).toBeInTheDocument(); expect(screen.getByText('Tablero')).toBeInTheDocument(); }); -
Visual regression: Capture screenshots of key pages in both languages using a tool like
playwright. Compare the snapshots to detect layout shifts caused
by longer Spanish strings. -
Manual QA: Navigate the app, switch languages, and verify that all dialogs, tooltips,
and error messages appear correctly. Pay special attention to right‑to‑left (RTL) support if you later add
Arabic or Hebrew.
Publishing the article
Once the localization passes all tests, commit the changes and push them to your repository. If you are
using UBOS CI/CD, the platform will automatically rebuild the Docker image and redeploy the updated
template.
git add .
git commit -m "Add Spanish localization"
git push origin main
# UBOS CI will trigger a new build automatically
After deployment, verify the live site by selecting Español from the language dropdown.
The UI should now display all strings in Spanish, and the URL should remain unchanged (language is handled
client‑side). Document the localization steps in your project’s README so future contributors can extend
support to additional languages without reinventing the wheel.
Conclusion
Localizing the OpenClaw Full‑Stack Template UI to Spanish is a straightforward process when you follow a
disciplined, MECE‑structured workflow: set up the project, add well‑structured translation files, update
components, test rigorously, and deploy via UBOS. This tutorial not only delivers a functional Spanish UI
but also establishes a repeatable pattern for future language expansions.
Remember that i18n is more than just translating text; it involves handling date, number, and currency
formats, as well as ensuring accessibility for non‑English speakers. By integrating these practices early,
you future‑proof your SaaS product and broaden its market reach across Spanish‑speaking regions.
Happy coding, and enjoy the new audience you’ll reach with a localized OpenClaw experience!