Skip to content

How translate ink text?

As explained in more detail here, Pixi’VN gives the possibility to translate the game text using a library, such as i18next. Also in ink + Pixi’VN integration you can use a library to translate the text of the ink.

Pixi'VN gives the developer the ability to intercept the translation event with the onInkTranslate function.

The onInkTranslate function has as a parameter a callback function takes as parameter the text to translate and returns the translated text.

ts
import { onInkTranslate } from '@drincs/pixi-vn-ink'
import { useTranslation } from "react-i18next";

const { t } = useTranslation(["narration"]);
onInkTranslate((text) => {
   return t(text)
})

Auto-generation of translation files

( Under development )