Weave Code
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

Lokalise Bundle Laravel Package

alicorn/lokalise-bundle

View on GitHub
Deep Wiki
Context7

Symfony webhook bundle for Lokalise

This bundle receives the webhook from lokalise.co and uploads the new translation files to your directories.

1. Installing the bundle

Require it with composer.

composer require alicorn/lokalise-bundle

2. Enable the bundle in your kernel

// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Alicorn\LokaliseBundle\AlicornLokaliseBundle(),
        // ...
    );
}

3. Configure the bundle routing

# app/config/routing.yml
  
# Webhook url configuration
alicorn_lokalise:
    resource: "@AlicornLokaliseBundle/Controller/"
    type:     annotation
    prefix:   /lokalise/webhook/ # your webhook url

4. Configure the bundle

# app/config/config.yml
 
# ...
 
alicorn_lokalise:
    # Webhook configuration
    host: "https://s3-eu-west-1.amazonaws.com/lokalise-assets/" # Lokalise host for downloads can be overwritten
    web_path: "web/locales" # Path for locale files #1
    symfony_path: "app/Resources/translations" # Path for locale files #2, can be blank
    extract_file: "/tmp/langs.zip"
    
    # API configuration
    api:
        api_token: "XXXXXXXXXXXXXXXXXXXXXX"
        project_id: "XXXXXXXXXXXXXXXXXXXXXX"
        type: "json"
        use_original: "0"
        bundle_structure: "%%LANG_ISO%%.%%FORMAT%%"
        base_url: "https://lokalise.co/api/"
        directory_prefix: "%%LANG_ISO%%"

5. Configure webhook on lokalise

Configure your webhook on lokalise.

screen shot 2017-05-03 at 16 43 42

When building the project in lokalise, it will trigger the webhook and unzip the translation files to the configured directories.

6. Download translations via cli

If the API is configured, you can use the import command to update all translation files locally.

php bin/console lokalise:import
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.
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
baks-dev/finances
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle