Localization
Kalamba SDK provides some localization tools to facilitate development. i18n
module is available on KalambaSdk
instance after open game.
// Create Kalamba SDK instance
const sdk = new KalambaSdk({ messagePort: window.parent })
// Configure wrapper
sdk.configure({ gameName: 'MY GAME', gameVersion: '1.0.0' })
// Open game
const response = await sdk.openGame()
// sdk.i18n is available
console.log('i18n', sdk.i18n)
// Show balance with currency
console.log('balance', sdk.i18n.formatCoinsWithCurrency(response.contract.balance.coins))
Language
-
The Game Client MUST support multiple languages.
-
The Game Client MUST use the language code provided in the
sdk.config
object to localize the game and to correctly format any dates and numbers presented to players. -
It is RECOMMENDED to use ECMAScript Internationalization API.
Currencies
-
The Game Client MUST support all official ISO-4217 currency codes and their respective currency symbols.
-
The Game Client MUST use the currency code provided in the
sdk.config
object to show money -
The Game Client MUST support the following crypto currency codes and their respective currency symbols: TBD.
-
The Game Client MUST support custom currency codes that are neither ISO-4217 currency codes or crypto currency codes.
-
The Game Client SHOULD use a commonly known symbol for a specific currency code. In case the Game Client doesn't have such symbol, it MUST show the currency code instead of the symbol.
-
The Game Client MUST support blank currency as well, meaning that if Kalamba SDK configuration indicates no currency or an empty string, the Game Client MUST NOT show any currency code or symbol.