fr3ddy/easytrans

易于使用的翻译支持。导出Excel文件,翻译后再导入。

dev-master 2016-11-24 13:59 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:14:37 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

Easytrans

!ALPHA 发布!

为您的多语言Laravel应用程序提供易于使用的翻译支持。

导出Excel文件,翻译后再导入。

就像听起来那么简单...

现在就试试!

安装

使用Composer安装此包

composer require fr3ddy/easytrans

将服务提供者添加到您的app/config.php providers数组中

Fr3ddy\Easytrans\EasytransServiceProvider::class,

将Excel服务提供者添加到您的app/config.php providers数组中

Maatwebsite\Excel\ExcelServiceProvider::class,

在您的app/config.php中添加别名到aliases数组

'Excel' => Maatwebsite\Excel\Facades\Excel::class,

使用以下命令发布配置

php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"

设置 "force_sheets_collection" = true (第466行)

用法

导出

在您的项目目录中运行以下命令,将在storage/easytrans文件夹中生成一个Excel文件。

php artisan easytrans:export {lang}

在此Excel文件中,您将为每种语言找到一个翻译文件的表格。您可以随意删除任何表格,导入时不会有问题。

导入

在您的项目目录中运行以下命令,将导入storage/easytrans文件夹中的Excel文件。我期望的文件名为{lang}.xls

php artisan easytrans:import {lang}

导入时,将创建备份文件,并基于表格名称生成所有表格的新文件。