cbi18n

Retrieve and render localized resource strings in ColdBox applications.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill cbi18n
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cbi18n
Source: https://github.com/ColdBox/skills/tree/main/modules/cbi18n
Command: npx skills add https://github.com/ColdBox/skills --skill cbi18n

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a consistent internationalization and localization layer for ColdBox and BoxLang applications so that user-facing strings are centralized, translations are manageable, and locale-specific formatting is correct across handlers, views, and modules.

Core Features & Use Cases

  • Installation and configuration of the cbi18n module with defaultResourceBundle, defaultLocale, and localeStorage options.
  • Support for resource bundle files in Java properties and JSON formats, plus multiple named bundles for areas like admin and emails.
  • Translation helpers to retrieve strings from bundles and perform positional or named substitutions for dynamic content.
  • Locale management and switching with persistence, plus Java-based date, number, and currency formatting per locale.
  • Programmatic access via injected i18n services in handlers for contexts where view helpers are unavailable.

Quick Start

Install and enable the cbi18n module, set defaultResourceBundle and defaultLocale in ColdBox.cfc, and call the getResource or $r helper in views to render translated strings.

Frequently Asked Questions about cbi18n

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

FAQPage Schema
How do I add internationalization and multilingual support to a ColdBox application?

To add internationalization to a ColdBox application, install the cbi18n module and configure defaultResourceBundle and defaultLocale in ColdBox.cfc. You can then retrieve and render localized strings using the getResource or $r helper in views.

Can I use JSON resource bundles for translations instead of Java properties files?

Yes, the cbi18n module supports resource bundle files in both Java properties and JSON formats. You can also define multiple named bundles to organize translations for specific areas like admin panels or emails.

How do I format dates and numbers for different user locales in ColdBox?

You can format dates, numbers, and currency for different locales in ColdBox by enabling optional Java locale-aware formatters within the cbi18n module configuration.

How do I switch user locales and persist the selection across requests?

You can switch user locales programmatically and persist the selection by configuring the optional localeStorage setting in the cbi18n module, which maintains the chosen locale across requests.

How do I handle dynamic content substitutions in localized resource strings?

The cbi18n module supports both positional and named substitutions for dynamic content. Translation helpers retrieve strings from bundles and inject dynamic variables into the localized output.

How do I access localized resource strings from handlers instead of views?

You can access localized resource strings programmatically by injecting the i18n service directly into your ColdBox handlers, which is useful when view helpers like getResource or $r are unavailable.