Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Crudit Translation Provider Laravel Package

2lenet/crudit-translation-provider

View on GitHub
Deep Wiki
Context7

Symfony Translation Provider backed by crudit-studio: your project's translations are centrally managed in crudit-studio, and synchronized with the standard translation:pull / translation:push commands — exactly like the official Loco, Crowdin or Lokalise providers, through a crudit:// DSN.

Installation

composer require 2lenet/crudit-translation-provider

If your app doesn't use Symfony Flex, register the bundle in config/bundles.php:

Lle\CruditTranslationProvider\LleCruditTranslationProviderBundle::class => ['all' => true],

Configuration

Declare the provider in config/packages/translation.yaml:

framework:
    translator:
        providers:
            crudit:
                dsn: '%env(CRUDIT_TRANSLATION_DSN)%'
                domains: []   # empty = all domains
                locales: []   # empty = your app's enabled_locales

And set the DSN in your .env.local:

CRUDIT_TRANSLATION_DSN=crudit://PROJECT_CODE:[email protected]
  • PROJECT_CODE — your project's code in crudit-studio,
  • TOKEN — the project's API token,
  • host (and optional port) of your crudit-studio instance, reached over HTTPS.

For a local crudit-studio over plain HTTP, add ?scheme=http:

CRUDIT_TRANSLATION_DSN=crudit://PROJECT_CODE:TOKEN@localhost:8328?scheme=http

Usage

# Send local translations to crudit-studio.
# crudit-studio NEVER overwrites a key it already knows (it may have been edited
# by a translator through its UI), so pushing is always safe.
bin/console translation:push crudit

# Fetch translations from crudit-studio into your local files
bin/console translation:pull crudit --force

Initial migration

There is no dedicated init command: the very first translation:push crudit against an empty crudit-studio project uploads your whole local catalogue (every key, locale and domain) and becomes the starting point managed in crudit-studio.

Translation file formats

The provider itself never reads or writes files — it exchanges message catalogues with the standard Symfony commands, which handle the local files:

  • translation:push loads your local files through Symfony's registered loaders, so every format supported by the Translation component works out of the box: YAML, XLIFF, JSON, PHP, CSV, INI, gettext (.po/.mo), Qt XML (.ts), ResourceBundle...
  • translation:pull writes local files in the format you ask for with --format (XLIFF 1.2 by default):
bin/console translation:pull crudit --force --format=yaml

Not supported

translation:push --delete-missing (the provider delete() operation) is not supported yet: for now, crudit-studio is the authority and keys are removed through its UI. We are looking into supporting this option in the near future.

Development

composer install
vendor/bin/phpunit
vendor/bin/phpcs
vendor/bin/phpstan analyse
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log