The Cactus I18n library implements i18n using the core technologies developed by Mozilla and Project Fluent. We chose Fluent because of it’s design principles, features, and extensibility. We use these tools to provide our own API that can be used to implement internationalization easily.
Because we make use of Fluent’s tools to make internationalization possible, our API uses translations written using the Fluent ftl syntax. You can find a small example of some features of Fluent’s syntax here.
Getting started with the internationalization tools that are available with the Cactus Framework is easy, and we have a quick guide for setting up a project to achieve internationalization, along with a working example to check out. To find out more about what you need to do to get started, go here.
yarn add @repay/cactus-i18n
// webpack.config.js
module.exports = {
// ... other config definitions
module: {
rules: [
// add this rule
{
test: /@fluent.*\.js$/,
use: {
loader: 'babel-loader',
options: {
// babel config / presets
},
},
},
],
},
}
We have detailed documentation on each of the classes, functions and components you’ll need to integrate internationalization into your application here.
If you are interested in learning more about why we chose to use Project Fluent over other similar i18n tools, check this out.