2017 © Pedro Peláez
 

library laravel-transtojson

Turn Laravel 5 dot.based.translations into JSON-based translations

image

hacktivista/laravel-transtojson

Turn Laravel 5 dot.based.translations into JSON-based translations

  • Friday, November 24, 2017
  • by Hacktivista
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel translations to JSON

Turn Laravel 5 dot.based.translations into JSON-based translations, (*1)

Installation

composer require hacktivista/laravel-transtojson --dev

Usage

php artisan translations:to_json path/to/process/ src_lang [dest_lang] [--debug]

E.g., (*2)

php artisan translations:to_json resources/views/ en es

It will: - Replace all trans('...') and __('...') translations found in files on path/to/process/ and subfolders with __("Textual translation strings") - Create a JSON file in resources/lang/ with textual translation strings *, (*3)

* If JSON file already exists it will merge results with what's already on it. If there's a match with a phrase already matched, contents on the JSON file will prevail., (*4)

THIS WILL OVERWRITE ALL FILES USING __() AND trans() FUNCTIONS IN path/to/process/ AND SUBDIRECTORIES. BE SURE TO BACKUP FILES PREVIOUS TO RUN THIS COMMAND!, (*5)

In order to check results without writing to files run with --debug option., (*6)

dest_lang is optional, if set, the resulting JSON file will have source language strings associated with destination language strings. If not, only source language strings with empty destination strings., (*7)

It will NOT delete translations in resources/lang/<lang>/, do it manually when you consider appropriate., (*8)

Contributing

If you'd like to contribute to this project please read CONTRIBUTING.md, (*9)

The Versions

24/11 2017

dev-master

9999999-dev

Turn Laravel 5 dot.based.translations into JSON-based translations

  Sources   Download

Unlicense

The Requires

 

24/11 2017

0.2.1

0.2.1.0

Turn Laravel 5 dot.based.translations into JSON-based translations

  Sources   Download

Unlicense

The Requires

 

16/11 2017

0.2.0

0.2.0.0

Turn Laravel 5 dot.based.translations into JSON-based translations

  Sources   Download

Unlicense

The Requires

 

16/11 2017

0.1.0

0.1.0.0

Turn Laravel 5 dot.based.translations into JSON-based translations

  Sources   Download

Unlicense

The Requires