Basic Usage
This guide covers the fundamental operations and features of Terry Translation.
Getting Started
After installation, you can start using Terry Translation in your project:
import { TerryTranslation } from 'terry-translation'
const terry = new TerryTranslation()
Basic Operations
Translating Text
const result = await terry.translate({
text: 'Hello, world!',
from: 'en',
to: 'es',
})
Working with Files
await terry.translateFile({
input: './content/en/messages.json',
from: 'en',
to: ['es', 'fr', 'zh'],
})
Project Management
Creating a Project
const project = await terry.createProject({
name: 'My Website',
sourceLanguage: 'en',
targetLanguages: ['es', 'fr', 'zh'],
})
Adding Content
await project.addContent({
key: 'welcome.message',
text: 'Welcome to our website',
})
Next Steps
To learn more:
- Explore Core Features
- Learn Best Practices
- Check out Advanced Features