koreezgames / phaser3-i18n-plugin

Phaser3 i18n Plugin
MIT License
22 stars 8 forks source link

shows only part of text #2

Closed RollinSafary closed 6 years ago

RollinSafary commented 6 years ago

if you've

const value: number = 123456
const text:string = `any string: ${value}`

usingtext in creating text object will show only text after :

const textObject = this.add.text(0, 0, text) result is 123456

if we remove : from string, everything works

const value: number = 123456
const text:string = `any string ${value}`
saqsun commented 6 years ago

@RollinSafary this issue is not related to this plugin. You should move this issue to the https://github.com/i18next/i18next repo

RollinSafary commented 6 years ago

issue in https://github.com/i18next/i18next, answer: https://www.i18next.com/overview/configuration-options I think it's mean that, there is a need to configure plugin :D

saqsun commented 6 years ago

So that is simple just change nsSeparator in config ;)

create () {
  this.i18n.initialize(
    {
      fallbackLng: 'en',
      loadPath: 'assets/i18n/{{lng}}/{{ns}}.json',
      debug: false,
      nsSeparator: '$'
    },
    function () {
      console.log('I18nPlugin initialized!')
    },
  )
}