# i18n
It is possible to add internationalization for plugins.
# Translate text
To add i18n files, use the i18n
plugin property. To translate a text, use $t("plugin-name.text-key")
.
Example:
const EN = {
"some-text": "en translation",
};
const FR = {
"some-text": "fr traduction",
};
const myPlugin = {
name: "myPlugin",
i18n: {
en: EN,
fr: FR,
},
component: {
template: "<div>{{$t('myPlugin.some-text')}}</div>"
}
};
# Set the viewer locale
To set the viewer local, use the locale
property of the makeBIMDataViewer
configuration object:
const viewer = makeBIMDataViewer({
locale: "en",
});
The available locales are:
- French : fr (default)
- English: en