PHPackages                             agency-orgo/string-translations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. agency-orgo/string-translations

ActiveLibrary[Localization &amp; i18n](/categories/localization)

agency-orgo/string-translations
===============================

A Statamic addon for managing string translations

v2.7.0(3mo ago)054MITPHPPHP ^8.3

Since Oct 20Pushed 6d agoCompare

[ Source](https://github.com/agency-orgo/string-translations)[ Packagist](https://packagist.org/packages/agency-orgo/string-translations)[ RSS](/packages/agency-orgo-string-translations/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (9)Versions (18)Used By (0)

String Translations
===================

[](#string-translations)

A Statamic addon for managing string translations with database or flat-file storage and fallback support.

Features
--------

[](#features)

- Database or flat YAML file storage, with YAML files committed by Statamic's Git automation
- Multi-language support with fallback hierarchy
- Bulk operations for performance
- Search and filter functionality
- Control Panel integration
- REST API and GraphQL support

Installation
------------

[](#installation)

You can install this addon via Composer:

```
composer require agency-orgo/string-translations
```

Usage
-----

[](#usage)

After installation, you'll find "String Translations" in your Statamic Control Panel under Utilities.

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=string-translations-config
```

```
return [
    'storage' => [
        'driver' => env('STRING_TRANSLATIONS_DRIVER', 'database'), // 'database' | 'yaml'
        'path' => env('STRING_TRANSLATIONS_PATH', resource_path('translations')),
    ],
    'database' => [
        'connection' => env('STRING_TRANSLATIONS_DB_CONNECTION', 'default'),
        'table' => env('STRING_TRANSLATIONS_TABLE', 'localized_strings'),
    ],
    'api' => [
        'enabled' => env('STRING_TRANSLATIONS_API_ENABLED', false),
    ],
];
```

Storage drivers
---------------

[](#storage-drivers)

`storage.driver` picks the one store the addon reads and writes. There is no mirroring between them.

### `database` (default)

[](#database-default)

Translations live in the `localized_strings` table. Run `php artisan migrate` after installing. Nothing changes if you leave `storage.driver` alone.

### `yaml`

[](#yaml)

Set `STRING_TRANSLATIONS_DRIVER=yaml`. Translations become flat YAML files, one per locale, under `storage.path` (default `resources/translations`):

```
resources/translations/
  en.yaml        # key: value (sorted)
  et.yaml
  .meta.yaml     # which values came from DeepL

```

No database or migration is needed. Commit `resources/translations/` and the files travel with your deploys and show up in pull requests like any other content.

The DeepL API key is not written into that directory. Under the yaml driver it goes, encrypted, into `storage/string-translations/settings.yaml`. Laravel's root gitignore only covers `storage/*.key`, so the addon writes a `.gitignore` alongside the file to keep the key out of your repository.

### Git sync

[](#git-sync)

With the yaml driver, the storage path is added to `statamic.git.paths` and both events are handed to Statamic's git subscriber. If you already run Statamic's Git automation (`STATAMIC_GIT_ENABLED=true`, `STATAMIC_GIT_AUTOMATIC=true`), translation saves and deletes queue commits exactly like content does, honouring your `statamic.git` queue, push and `ignored_events` settings. There is nothing else to set up.

### Switching drivers

[](#switching-drivers)

Two commands move existing data between the stores. They are one-time migrations, not a sync:

```
php artisan strings:export   # database -> yaml files at storage.path
php artisan strings:import   # yaml files (and legacy lang/*.json) -> database
```

`strings:import --force` truncates the table before importing.

REST API
--------

[](#rest-api)

Enable with `STRING_TRANSLATIONS_API_ENABLED=true` in your `.env`.

**Fetch translations:**

```
curl "https://your-site.com/!/string-translations/strings?lang=en"
```

**Create keys:**

```
curl -X POST "https://your-site.com/!/string-translations/strings" \
  -H "Content-Type: application/json" \
  -d '{"keys": ["nav.home", "nav.about"]}'
```

GraphQL
-------

[](#graphql)

Automatically available when Statamic's GraphQL is enabled (`STATAMIC_GRAPHQL_ENABLED=true`). No additional configuration needed.

### Fetch translations

[](#fetch-translations)

```
{
  string_translations(lang: "en") {
    lang
    strings
  }
}
```

Response:

```
{
  "data": {
    "string_translations": {
      "lang": "en",
      "strings": {
        "nav.home": "Home",
        "welcome.message": "Welcome!"
      }
    }
  }
}
```

### Create translation keys

[](#create-translation-keys)

Creates keys across all configured sites with an `untranslated_` prefix.

```
mutation {
  createStringTranslations(keys: ["nav.contact", "footer.copyright"]) {
    created
  }
}
```

Response:

```
{
  "data": {
    "createStringTranslations": {
      "created": 12
    }
  }
}
```

The `created` count reflects total rows inserted (keys \* sites). Duplicate keys are ignored.

Events
------

[](#events)

The addon dispatches Statamic-style content events for every write so other parts of the system can react. Both extend `Statamic\Events\Event` and implement `Statamic\Contracts\Git\ProvidesCommitMessage`, which supplies the commit message under the yaml driver.

EventWhen`AgencyOrgo\StringTranslations\Events\TranslationsSaved`Any insert or value change. Carries `$lang` (the locale, or `null` for cross-locale operations like `createStringTranslations`) and `$keys` (the affected keys).`AgencyOrgo\StringTranslations\Events\TranslationsDeleted`Cross-locale key removal. Carries `$keys`.### GraphQL response cache

[](#graphql-response-cache)

Statamic's GraphQL response cache (`config/statamic/graphql.php` → `cache.expiry`, default 60min) is automatically invalidated whenever a translation event fires — the addon registers a listener in its service provider that calls `Statamic\Contracts\GraphQL\ResponseCache::handleInvalidationEvent()`. Frontends consuming `string_translations(lang: …)` over GraphQL will see saves on the next request without any manual `php artisan cache:clear`. The listener is skipped when GraphQL is disabled or when `statamic.graphql.cache` is `false`.

### Listening to events

[](#listening-to-events)

```
use AgencyOrgo\StringTranslations\Events\TranslationsSaved;
use Illuminate\Support\Facades\Event;

Event::listen(TranslationsSaved::class, function (TranslationsSaved $event) {
    // $event->lang, $event->keys
});
```

Requirements
------------

[](#requirements)

- Statamic 6.0+
- PHP 8.3+

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance92

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

17

Last Release

92d ago

Major Versions

v1.0.1 → v2.0.02026-02-12

v1.1.0 → 5.x-dev2026-03-09

v1.1.1 → v2.6.02026-03-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/b21a9330063efad19e3079adac8cbc442ffe5c99e3c87d78126ac787ac64a0f9?d=identicon)[karlromets](/maintainers/karlromets)

---

Top Contributors

[![karlromets](https://avatars.githubusercontent.com/u/108818570?v=4)](https://github.com/karlromets "karlromets (37 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agency-orgo-string-translations/health.svg)

```
[![Health](https://phpackages.com/badges/agency-orgo-string-translations/health.svg)](https://phpackages.com/packages/agency-orgo-string-translations)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[statamic/seo-pro

71548.3k](/packages/statamic-seo-pro)[statamic/statamic

Statamic

832182.1k](/packages/statamic-statamic)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[statamic/eloquent-driver

Allows you to store Statamic data in a database.

128790.9k21](/packages/statamic-eloquent-driver)[rias/statamic-redirect

29347.4k](/packages/rias-statamic-redirect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
