springboot-i18n

Implement Spring Boot and Thymeleaf internationalization with MessageSource and locale switchers.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/chartsai/member-system-cc-skills --skill springboot-i18n
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: springboot-i18n
Source: https://github.com/chartsai/member-system-cc-skills/tree/main/springboot-i18n
Command: npx skills add https://github.com/chartsai/member-system-cc-skills --skill springboot-i18n

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill adds full internationalization (i18n) support to a Spring Boot + Thymeleaf application, including Spring MessageSource configuration, per-locale message property files, a CookieLocaleResolver-based locale switcher, and Thymeleaf #{key} integration.

Core Features & Use Cases

  • MessageSource configuration for centralized UI text translation.
  • Per-locale properties for English, Traditional Chinese, Japanese, and more.
  • Locale switcher component to toggle language in the UI and persist user choice.
  • Thymeleaf integration using #{key} lookups to render translated content.

Quick Start

Configure i18n by enabling MessageSource, adding per-locale properties, and wiring a locale switcher in Thymeleaf.

Frequently Asked Questions about springboot-i18n

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add internationalization to a Spring Boot application?

You can implement internationalization by configuring Spring MessageSource, creating per-locale properties for multiple languages, and wiring a CookieLocaleResolver to persist user language choices across the application.

How do I use Thymeleaf message lookups for multi-language UI?

Thymeleaf message lookups use the `#{key}` syntax to render translated content dynamically. By integrating with Spring MessageSource, Thymeleaf automatically resolves and displays UI text based on the active locale's property files.

What is the best way to implement a locale switcher in Spring Boot?

The best way to implement a locale switcher in Spring Boot is using a CookieLocaleResolver. This approach persists the user's selected language in a cookie, automatically presenting content in their chosen locale on subsequent visits.

Does Spring Boot MessageSource support Traditional Chinese and Japanese locales?

Yes, Spring Boot MessageSource supports Traditional Chinese and Japanese locales. You configure it by adding specific per-locale message property files, allowing the application to serve translated content for these languages.

Why are my Thymeleaf internationalization messages not displaying correctly?

Thymeleaf internationalization messages fail to display correctly if Spring MessageSource is not properly configured or if per-locale properties files are missing. Ensure the MessageSource bean points to the correct basename and locale resolver is set.