Managing Translations
Translations are the core of LangSyncer. Each translation consists of a key, a group, and values in multiple languages.
Understanding Translations
Translation Structure
Each translation has:
| Field | Description | Example |
|---|---|---|
| Group | Organizes translations (like Laravel lang files) | messages, auth, validation |
| Key | Unique identifier within the group | welcome, login.title |
| Values | Text in each language | EN: "Welcome", ES: "Bienvenido" |
How It Maps to Laravel
In LangSyncer:
Group: messages
Key: welcome
Value (en): Welcome to our application
Value (es): Bienvenido a nuestra aplicacion
In Laravel files:
// resources/lang/en/messages.php
return [
'welcome' => 'Welcome to our application',
];
// resources/lang/es/messages.php
return [
'welcome' => 'Bienvenido a nuestra aplicacion',
];
// Usage in code:
__('messages.welcome')
Scopes: Project vs Global
Translations can exist in two scopes:
| Scope | Description | Visibility |
|---|---|---|
| Project | Specific to one project | Only in that project |
| Global | Shared across all projects in your account | Available to all projects |
More on global translations in the Global Translations Library section.
Creating Translations
Step-by-Step
- Go to Translations
- Select your project (or switch to Global scope)
- Click Add Translation
- Fill in the form:
| Field | Required | Description |
|---|---|---|
| Group | Yes | Lowercase, no spaces (e.g., messages) |
| Key | Yes | Use dot notation for nesting (e.g., profile.title) |
| Values | At least one | Enter text for each language |
- Optionally, use AI Autofill to translate to other languages (see AI Autofill)
- Click Save
Note: New translations are saved as drafts. They won't be live until you Publish.
Key Naming Best Practices
Use lowercase and dots:
auth.login.button
profile.settings.title
validation.email.required
Be descriptive but concise:
user.greeting (good)
user_greeting_message (avoid underscores)
Mirror your app structure:
checkout.cart.empty
checkout.payment.success
checkout.confirmation.title
Using Placeholders
Laravel supports placeholders for dynamic content:
Welcome back, {name}!
You have :count new messages.
The AI translation preserves placeholders automatically.
Editing Translations
Edit a Single Translation
- Find the translation in the list
- Click the Edit button to open the edit modal
- Modify any language value
- Optionally, use AI Autofill to translate to other languages (see AI Autofill)
- Click Save
Changes are saved as a draft version until published.
Status Indicators
| Badge | Meaning |
|---|---|
| Active (green) | Published and live |
| Pending (yellow) | New or edited, not yet published |
AI Autofill
Use AI to automatically translate content to all project languages. This feature is available both when creating and editing translations.
How to Use
- Enter text in your source language (e.g., English)
- Select the Source Language if needed (defaults to project's base language)
- Click AI Autofill
- AI translates to all empty language fields
- Review and adjust if needed
- Click Save
AI Translation Features
- Context-Aware: Uses the key name for context
- Placeholder Preservation: Keeps
{name},:countintact - Format Preservation: Maintains line breaks and punctuation
Quota Consumption
Each AI translation consumes 1 unit from your quota:
- Account-level quota from your subscription tier
- Project-level limits (if configured)
If you hit a limit, you'll see a warning and AI translation will stop.
Selecting Source Language
By default, the source language is your project's base language. To translate from a different language:
- Use the Source Language dropdown in the edit form
- Select the language with the text you want to translate from
- Click AI Autofill
Versioning System
LangSyncer uses a versioning system so you can make multiple edits before publishing.
How It Works
Edit -> Save (Draft) -> Edit Again -> Save (Draft) -> ... -> Publish (Active)
- Save creates or updates a draft version
- Draft versions are NOT visible to your applications
- Publish promotes all drafts to active
- Applications only see active versions
Benefits
- Batch Edits: Make many changes, publish once
- Review Before Live: Check all changes before deploying
- Efficient CDN Updates: One CDN regeneration per publish, not per edit
Viewing Version History
- Find the translation
- Click the History icon
- See all versions with:
- Version number
- Status (Draft/Active/Archived)
- When published
- Who published it
Actions available:
- View: See the translation values for that version
- Rollback: Restore a previous version as a new draft (does not affect the current active version until you publish)
Publishing Translations
Publishing makes your draft translations live.
How to Publish
- Make your edits and save (creates drafts)
- Click the Publish button (top of translations page)
- Review the pending changes count
- Add optional Release Notes (recommended)
- Click Publish
What Happens When You Publish
- All draft versions become active
- Previous active versions are archived
- CDN files are regenerated (delayed ~30 seconds)
- Webhooks are dispatched (delayed ~2-3 minutes)
- A publication record is created
Multi-Project Publishing
If you're a Super Admin or have access to multiple projects:
- Click Publish without selecting a project
- See all projects with pending changes
- Select which projects to publish
- Click Publish Selected
Each project is published sequentially with progress indicators.
Who Can Publish
| Role | Can Publish |
|---|---|
| Project Admin | Yes |
| Translator | No |
Publication Tips
Batch your changes:
- Make multiple edits throughout the day
- Publish once at the end
- Reduces CDN regeneration overhead
Add release notes:
- Document what changed and why
- Helps with troubleshooting later
- Example: "Fixed checkout button translations, added FAQ section"
Global Translations Library
Global translations are shared across all projects in your account.
Use Cases
- Common UI: "Save", "Cancel", "Delete", "Close"
- Standard Messages: "Success!", "Error occurred", "Loading..."
- Form Validation: "Required field", "Invalid email"
Benefits
- No Duplication: Define once, use everywhere
- Consistency: Same terms across all projects
- Easy Updates: Change globally affects all projects
Creating Global Translations
- Switch to Global scope (button at top of translations page)
- Click New Translation
- Fill in group, key, and values
- Click Save
- Publish to make available to all projects
Overriding Global Translations
Sometimes a project needs a different value for a global translation.
Example:
- Global:
common.submit= "Submit" - Project A needs: "Send Application"
To Create an Override:
- Go to Global scope
- Select the translation(s) you want to override
- Click Actions > Copy to Project
- Select the target project
- Edit the values in the project
- Save and Publish
How Overrides Work:
- Project translation takes precedence over global
- Global remains unchanged for other projects
- Delete the project translation to revert to global
Promoting to Global
You can promote project translations to global:
- Select translations (checkboxes)
- Click Bulk Actions > Promote to Global
- Handle any conflicts (same group/key already exists globally)
- Confirm
Bulk Operations
Perform actions on multiple translations at once.
Selecting Translations
- Individual: Click checkbox next to translation
- Current Page: Click "Select All" checkbox in header
- All Matching: Click "Select all X matching" banner
Available Bulk Actions
Bulk Delete
- Select translations
- Click Bulk Actions > Delete
- Confirm deletion
Warning: Deleted translations cannot be recovered.
Bulk Change Group
Move translations to a different group:
- Select translations
- Click Bulk Actions > Change Group
- Enter new group name
- Click Update
Creates drafts - remember to publish.
Bulk Export
Export selected translations:
- Select translations
- Click Bulk Actions > Export
- Choose format: JSON or CSV
- Select languages to include
- Click Export
JSON Format:
{
"messages.welcome": {
"en": "Welcome",
"es": "Bienvenido"
}
}
CSV Format:
group,key,en,es
messages,welcome,Welcome,Bienvenido
Bulk Copy to Project
Copy translations to another project:
- Select translations
- Click Bulk Actions > Copy to Project
- Select target project
- Click Copy
By default, "Skip if translation already exists" is checked. Uncheck it to resolve conflicts manually—a modal will let you choose which existing translations to override.
Bulk Promote to Global
Promote project translations to global:
- Select translations
- Click Bulk Actions > Promote to Global
- Click Promote
By default, "Skip if translation already exists" is checked. Uncheck it to resolve conflicts manually.
Filtering and Searching
Search
Type in the search box to filter by:
- Key (partial match)
- Group (partial match)
Filters
Group Filter:
- Select a specific group
- Only shows groups with translations
Status Filter:
- All: Show everything
- Active: Only published translations
- Pending: Only translations with unpublished changes (new or edited)
Sorting
Click column headers to sort by:
- Group
- Key
- Status
Click again to reverse direction.
Best Practices
Organize with Groups
Mirror Laravel's convention:
auth- Login, register, password resetvalidation- Form validation messagespagination- Pagination textpasswords- Password reset messages
Add your own:
marketing- Landing page contentemails- Email templateserrors- Error messagesapi- API response messages
Workflow Recommendations
- Developer adds keys with source language values
- Use AI translation for initial pass
- Review AI output - especially for marketing/legal content
- Test in app before publishing
- Batch publish at end of day/sprint
Security
- Translation values can contain HTML - sanitize when needed
- Placeholders like
{name}should use escaped output in templates - Review AI translations for unexpected content
Troubleshooting
Translation Not Appearing in App
- Did you Publish? Check for pending badge
- Has your app synced? Run
php artisan translator:sync - Is caching enabled? Clear cache:
php artisan cache:clear - Check group/key spelling (case-sensitive)
AI Translation Not Working
- Verify you have quota remaining
- Check if source language has content
- Review error messages in the toast notification
Publish Button Disabled
- No pending changes to publish
- You don't have publish permissions (need Project Admin role)
Next Steps
- AI Translations - Deep dive into AI features
- Code Scanner - Scan your codebase for translations
- Quota Management - Understand and manage quotas