2lenet/crudit-translation-provider
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.
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],
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,For a local crudit-studio over plain HTTP, add ?scheme=http:
CRUDIT_TRANSLATION_DSN=crudit://PROJECT_CODE:TOKEN@localhost:8328?scheme=http
# 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
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.
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
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.
composer install
vendor/bin/phpunit
vendor/bin/phpcs
vendor/bin/phpstan analyse
How can I help you explore Laravel packages today?