openclassrooms/onesky-bundle
Symfony bundle for integrating OneSky translation services into PHP applications. It helps manage localization workflows and keep translation files synchronized with OneSky projects, simplifying configuration and exchange of source and translated content in Symfony apps.
A necessary reality check before any setup: openclassrooms/onesky-bundle is a Symfony bundle, not a Laravel package. It registers via Symfony's bundle system and ships an OpenClassroomsOneSkyBundle plus a DI extension. There is no ServiceProvider, no facade, no auto-discovery. For a Laravel developer the realistic options are:
onesky/php-sdk. This is what the bundle wraps anyway, and it is the recommended path.Minimal setup (Laravel path, recommended):
composer require onesky/php-sdk
Bind the client as a singleton in AppServiceProvider:
$this->app->singleton(\OneSky\ApiClient::class, fn () => new \OneSky\ApiClient(
config('services.onesky.api_key'),
config('services.onesky.api_secret'),
));
Then create one Artisan command (onesky:pull) that calls $client->translations->download($projectId) and writes the returned file(s) into lang/{locale}/.
Minimal setup (Symfony path, if you're actually on Symfony):
composer require openclassrooms/onesky-bundle
Register OpenClassrooms\Bundle\OneSkyBundle\OpenClassroomsOneSkyBundle in config/bundles.php, then:
openclassrooms_one_sky:
api_key: '%env(ONESKY_API_KEY)%'
api_secret: '%env(ONESKY_API_SECRET)%'
project_id: '%env(ONESKY_PROJECT_ID)%'
First useful command: bin/console onesky:download --locale=fr_FR. If it produces non-empty output, credentials are wired correctly.
Where to look first in the repo: the Command/ and Service/ directories. They are thin and read well as a recipe for what you need to replicate.
onesky:upload / onesky:download. In Laravel: two Artisan commands driven by $schedule->command('onesky:pull')->hourly() and a separate push triggered by a deploy step.config('app.locales')) instead of a single "download all." A failure on zh_Hans should not roll back a successful fr_FR, and you get clearer logs..strings, or .properties. Laravel's __() loader reads PHP arrays (resources/lang/{locale}/*.php) or JSON (resources/lang/{locale}.json). Pick JSON — it maps cleanly — and either commit it directly or transform to PHP arrays in a second step.Target [...] is not instantiable. Bind the SDK yourself.onesky/php-sdk version and expect to own the wrapper long-term.fr-FR, zh-Hans, pt-BR; Laravel commonly uses fr_FR, zh_CN. Map these explicitly. The symptom is a successful download that produces an empty or English-only file.resources/lang/, or you'll blank out a locale on a transient API hiccup.api_key, project_id). If you reimplement the config, mirror the bundle's DependencyInjection/Configuration.php exactly — the SDK sometimes expects camelCase internally and silently ignores the wrong key.messages.json and pull messages.en.json and you'll get partial merges. Keep push and pull pointing at the same canonical names.retry(3, 1000) or Guzzle's RetryMiddleware — OneSky's API rate-limits under bulk operations.Authorization/signature header before anything hits storage/logs.Http::fake() (the SDK uses Guzzle, which Http::fake() intercepts) or bind a fake ApiClient interface in feature tests.OneSkyService around onesky/php-sdk. You lose almost nothing and gain a surface you can maintain.How can I help you explore Laravel packages today?