Translations

Lens supports English and German language out of the box. You can set the language to en or de in the Lens options:

"language": "de"

Overwriting texts

You can overwrite the built-in translations in the Lens options to customize the text:

"texts": {
    "loading": {
        "en": "Processing..."
    }
}

Or add translations for new languages:

"texts": {
    "loading": {
        "es": "Cargando..."
    }
}

Or you can add your own texts that you can then translate in your application. We recommend that you prefix the key with your project name to avoid collisions:

"texts": {
    "ccp-welcome": {
        "en": "Welcome to CCP Explorer!",
        "de": "Willkommen beim CCP Explorer!"
    }
}

Using translations in your application

You can also use the translations in your application:

<script lang="ts">
    import { translate } from "@samply/lens";
</script>

<span>{translate("loading")}</span>