2017 © Pedro Peláez
 

library langjs

Compile lang files to be used within js

image

awkwardideas/langjs

Compile lang files to be used within js

  • Thursday, March 2, 2017
  • by awkwardideas
  • Repository
  • 1 Watchers
  • 5 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

LangJS: Compile lang files to a js file for use on client side

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Install Via Composer

composer require awkwardideas/langjs, (*2)

Add to config/app.php

Under Package Service Providers Add, (*3)

AwkwardIdeas\LangJS\LangJSServiceProvider::class,, (*4)

Build LangJS script file

  1. run php artisan langjs:build --d js/LangJS.js
  2. Adjust the --d path to whatever you would like under your public directory
  3. Include this script file into your layout
  • You must run the build command any time you want to recompile the language file changes. A watchdog may be built in the future but is not currently available
  • This only compiles the lang files within your resources/lang folder. Vendor lang files are not included currently.

Javascript commands

  • _lang(key [, replace, locale]), (*5)

    • Same setup as @lang('auth.user'), will retrieve your language for password which you put in your php lang file auth.php.
    • Replace and locale are optional parameters
    • Locale will default to en, if not provided.
    • If key has a plural form, the singular version will be returned, instead of the full term value
  • _choice(key, number [, replace, locale]), (*6)

    • Same setup as @choice('auth.user',2)
    • Replace and locale are optional parameters
    • Locale will default to en, if not provided.

The Versions

02/03 2017

1.0.x-dev

1.0.9999999.9999999-dev

Compile lang files to be used within js

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Chad Haney
by Awkward Ideas

02/03 2017

dev-master

9999999-dev

Compile lang files to be used within js

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Chad Haney
by Awkward Ideas

02/03 2017

v1.0.0

1.0.0.0

Compile lang files to be used within js

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Chad Haney
by Awkward Ideas