SDK's
Typescript
TS SDK
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
TS SDK
npx locale-sync gen
pnpx locale-sync gen
bunx locale-sync gen
npx locale-sync upload
pnpx locale-sync upload
bunx locale-sync upload
const translator = new Translator("en", "your-api-token", "your-repository-id");
translator.fetch();
import {translator} from "@/di";
export const MyComponent = () => {
const translator = inject<Translator>("translator");
return (
<h2>
{{translator.translate('myString')}}
</h2>
);
}
<script setup lang="ts">
import {translator} from "@/di";
const translator = inject<Translator>("translator");
</script>
<template>
<h2>
{{translator.translate('myString')}}
</h2>
</template>
const message = translator.translate('minValidation',8, {name: 'Password'});
// Handle validation logic
{
"en": {
"minValidation" : {
"plural" : "{name} deve ter no mínimo {count} caracteres",
"value" : "{name} deve ter no mínimo 1 caracter"
}
}
}