Skip to content

laravel-enso/localisation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

620 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Localisation

License Stable Downloads PHP Issues Merge Requests

Description

Localisation manages Enso languages, JSON translation files, and request-time language selection.

The package exposes language CRUD and translation-file editing endpoints, registers the set-language middleware alias, and ships commands for publishing locale files and scanning the codebase for missing translation keys.

It is intended for Enso applications that maintain multiple UI languages and JSON translation stores.

Installation

Install the package:

composer require laravel-enso/localisation

Run the package migrations:

php artisan migrate

Optional publishes:

php artisan vendor:publish --tag=localisation-config
php artisan vendor:publish --tag=localisation-factory
php artisan vendor:publish --tag=localisation-seeder

Features

  • Language CRUD, options, table init, table data, and Excel export endpoints.
  • JSON translation editing, saving, and key-creation endpoints.
  • set-language middleware alias for per-request locale switching.
  • enso:localisation:publish command for generating locale folders and JSON files.
  • enso:localisation:scan command for finding missing keys and duplicate translations.

Usage

Main route groups:

  • system.localisation.*
  • system.localisation.editTexts
  • system.localisation.getLangFile
  • system.localisation.saveLangFile
  • system.localisation.addKey

Artisan commands:

php artisan enso:localisation:publish --locale=ro
php artisan enso:localisation:scan --dry-run

API

HTTP routes

  • GET api/system/localisation/create
  • POST api/system/localisation
  • GET api/system/localisation/{language}/edit
  • PATCH api/system/localisation/{language}
  • DELETE api/system/localisation/{language}
  • GET api/system/localisation/initTable
  • GET api/system/localisation/tableData
  • GET api/system/localisation/exportExcel
  • GET api/system/localisation/options
  • GET api/system/localisation/editTexts
  • GET api/system/localisation/getLangFile/{language}
  • PATCH api/system/localisation/saveLangFile/{language}
  • PATCH api/system/localisation/addKey

Middleware

  • set-language

Artisan commands

  • enso:localisation:publish
  • enso:localisation:scan

Depends On

Required Enso packages:

Companion frontend package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

About

Laravel Enso Localisation package, meant to make it easy to build an application and offer it in multiple language versions

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages