awkwardideas/langjs
Composer 安装命令:
composer require awkwardideas/langjs
包简介
Compile lang files to be used within js
README 文档
README
Install Via Composer
composer require awkwardideas/langjs
Add to config/app.php
Under Package Service Providers Add
AwkwardIdeas\LangJS\LangJSServiceProvider::class,
Build LangJS script file
- run
php artisan langjs:build --d js/LangJS.js - Adjust the --d path to whatever you would like under your public directory
- 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])- 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
- Same setup as
-
_choice(key, number [, replace, locale])- Same setup as
@choice('auth.user',2) - Replace and locale are optional parameters
- Locale will default to en, if not provided.
- Same setup as
统计信息
- 总下载量: 159
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-22