yaroslawww/laravel-i18n-strings-batch 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yaroslawww/laravel-i18n-strings-batch

Composer 安装命令:

composer require yaroslawww/laravel-i18n-strings-batch

包简介

Simple way to transfer strings to js component without load all lang files or additional ajax requests.

README 文档

README

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Installation

Install the package via composer:

composer require yaroslawww/laravel-i18n-strings-batch

Usage

Set specific directory for language strings.

As usually js strings has other formatting for choise and others - you will want set all js strings to specific directory and call batches without specify directory each time:

use I18nStringsBatch\I18nStringsBatchManager;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        I18nStringsBatchManager::setDefaultDirectoryPrefix('front-js');
    }
}

Usage in php

\I18nStringsBatch\Facades\I18nStringsBatch::getBatch(["licenses-list", "modal-confirmation"]);
\I18nStringsBatch\Facades\I18nStringsBatch::getBatchJson(["licenses-list", "modal-confirmation"]);
// or
\I18nStringsBatch\Facades\I18nStringsBatch::getBatch("modal-confirmation");
\I18nStringsBatch\Facades\I18nStringsBatch::getBatchJson("modal-confirmation");

// Using helpers
i18n_strings_batch(["licenses-list", "modal-confirmation"])
i18n_strings_batch_json(["licenses-list", "modal-confirmation"])
// or
i18n_strings_batch("modal-confirmation")
i18n_strings_batch_json("modal-confirmation")

Usage with component

<licenses-list
    :i18n-batch='@transBatch("licenses-list")'
/>
<!-- or -->
<licenses-list
    :i18n-batch='@transBatch(["licenses-list", "modal-confirmation"])'
/>

Usage with vue

Optionally publish assets

php artisan vendor:publish --tag=i18n-string-batch-resources --force

Example you can find there

Add directive to PHPStorm

transBatch
<?php echo i18n_strings_batch_json(
); ?>

Credits

  • Think Studio

统计信息

  • 总下载量: 60
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固