Skip to content
This repository has been archived by the owner on Dec 4, 2019. It is now read-only.

motia/laravel-transaltions-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Translations Exporter

This package comes with a translation manager laravel-translation-manager and gives it the ability to import/export and a translation group to json or yaml.

Setup

  • Install the package.
composer require motia/laravel-translation-exporter
  • (optional if autodiscovery is on) Add the service provider Motia\TransExport\TransExportProvider
  • Publish the config file using the command
php artisan vendor:publish --provider="Motia\TransExport\TransExportProvider"

Usage

  • Import translations from file to database
php artisan trans:import
  • Export translations from database to file
php artisan trans:export
  • Missing translations This package comes with a controller to add missing translations and a helper function to add it to your routes.
// routes/api.php
<?php

use Motia\TransExport\Controller as TransExportController;

TransExportController::routes([
   'prefix' => 'trans-export',
   'middleware' => 'cors',
]);

// on your client app
axios.post('/missing', {
    key: 'namespaced.key',
    locale: 'en'
})

About

Utility package to use your translations in your laravel backend and client app at the same time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages