anourvalar/laravel-interpreter 问题修复 & 功能扩展

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

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

anourvalar/laravel-interpreter

最新稳定版本:2.10.14

Composer 安装命令:

composer require anourvalar/laravel-interpreter

包简介

Laravel's locales translate through the single (flat) file

README 文档

README

  • Export all untranslated phrases from your project to a single file for a translator.
  • Import all translated phrases from a single file to your project's structure.
  • Find & wrap text phrases with missed @lang() directive in your blade templates.

Installation

composer require anourvalar/laravel-interpreter --dev

Usage: basic flow

Step #1: Create schema (config) for a target locale

php artisan interpreter:schema ru

Step #2: Fill in the config

{
  "source_locale": "en", // reference (source) locale
  "target_locale": "ru",

  "adapter": "AnourValar\\LaravelInterpreter\\Adapters\\JsonAdapter",
  "filename": "ru_i18.json",

  "include_json": true, // include phrases from lang/en.json

  "lang_files": {
    "exclude": [],

    "include": [
      "/admin/" // include all files inside folder lang/en/admin/*
    ],

    "exclude_keys": []
  },

  "view_files": {
    "exclude": [],

    "include": [
      "/admin/" // include all files (parse phrases) inside folder views/admin/*
    ]
  },

  "exclude_phrases": ["ID", "Email", "E-Mail"],
  "include_pattern": null // "white" filter (regexp)
}

Step #3: Export untranslated phrases to a single file for a translator

php artisan interpreter:export ru

This command also display all unwrapped (with missing @lang) phrases.

Step #4: Import the completed single file to the project's structure

php artisan interpreter:import ru

Usage: wrap

php artisan interpreter:wrap resources/views/test.blade.php

Original template

<div>Привет, Мир!</div>

Modified template

<div>@lang('Привет, Мир!')</div>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固