Multiple language and currency support
Ruby storefronts (B2C and B2B) support multiple languages and currencies. You can view content and pricing in their preferred language and currency.
Multiple language support
- To enable multiple language support in Ruby storefronts (B2C and B2B):
-
- Manually build the index if it is not triggered automatically after setting up the languages.
-
Configure the i18n settings in your Next.js application to reflect the configured languages. Ensure all the languages configured in the Commerce+ Store Management tool are included in your Next.js
i18nconfiguration. -
Refer to the Next.js official guide at https://nextjs.org/docs/pages/building-your-application/routing/internationalization.
languageCode_countryCode.For more information about Multiple languages, see Multiple languages for the Ruby storefront.
Here is an example of the Next.js
i18n configuration. The locale language codes are in lowercase to
create user-friendly URLs in the Next.js store, such as
www.store.com/en-us/furniture.
i18n: {
locales: [
'default',
'de-de',
'en-us',
'es-es',
'fr-fr',
'it-it',
'ja-jp',
'ko-kr',
'pl-pl',
'pt-br',
'ro-ro',
'ru-ru',
'zh-cn',
'zh-tw',
],
defaultLocale: 'default',
localeDetection: false,
},
- Locale language detection scenario
-
- Single language support
-
If the store supports only one language, it always displays content in that language. In this case, the Next.js store application uses the defaultLocale, which maps to the store default language configured in Commerce+.
- Multiple languages support
-
-
- Supported locale language in the URL
-
The store page is displayed in the language specified in the URL, for example, https://www.store.com/en-us/myruby.
-
- Unsupported or unrecognized locale language in the URL
-
The client receives a 404 response. For example, if
zh-twis not supported, the URL https://www.store.com/zh-tw/myruby results in a 404 response.
-
- No locale language specified in the URL (this defaults to the store default language configured in Commerce+)
-
For example, https://www.store.com/myruby
-
Multiple currency support
When you changes your currency preference, the currency is updated in your context and applied to product and category requests sent to the Search server. This ensures that the displayed prices are always in your preferred currency. Price Pending is displayed when the selected currency is not enabled for the store.