定制 translators-hive/laravel-autotranslate 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

translators-hive/laravel-autotranslate

最新稳定版本:v1.0.1

Composer 安装命令:

composer require translators-hive/laravel-autotranslate

包简介

Translators Hive Laravel Autotranslate Package

README 文档

README

Translators Hive Laravel Autotranslate is a small tool for Laravel that gives you the ability to extract and auto translate untranslated string from your project files with one command.

Support

admin@translators-hive.com

Installation

You can install the package via composer:

composer require translators-hive/laravel-autotranslate

This package makes use of Laravels package auto-discovery mechanism, which means if you don't install dev dependencies in production, it also won't be loaded.

You can publish the config file with:

php artisan vendor:publish --provider="TranslatorsHive\LaravelAutoTranslate\ServiceProvider" --tag="config"

Usage

Configure translators-hive.com api credentials in your .env file

    TranslatorsHiveEmail='your email here'
    TranslatorsHivePassword='your password here'

To collect, extract and auto translate all the strings you need to run:

php artisan th:translate es,bg,de,fr

This command will create (if don't exist) es.json, bg.json, de.json and fr.json files inside the resources/lang directory. If you have short keys enabled and used in your files (e.g. auth.failed) the command will create folders es, bg, de and fr inside resources/lang directory and PHP files inside by the short key's prefix (e.g. auth.failed).

You can also run the artisan command without the country code arguments.

php artisan th:translate

In this case translation strings will be generated for the language specified in app.locale config.

Note: Strings you have already translated will not be overwritten.

Key Sorting

By default, the strings generated inside those JSON files will be sorted alphabetically by their keys. If you want to turn off this feature just set sort => false in the config file.

Searching

The way the strings are being collected and extracted is simple.

Searching is inside the directories defined in search.dirs config, using patterns defined in search.patterns, and finally is looked to collect strings which are the first argument of the functions defined in search.functions.

You can change any of these values inside the config file to suit you own needs.

Translating

Changelog

Please see CHANGELOG for more information on what has changed recently.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2022-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固