定制 itx-technologies/artisan-resx-to-lang 二次开发

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

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

itx-technologies/artisan-resx-to-lang

Composer 安装命令:

composer require itx-technologies/artisan-resx-to-lang

包简介

README 文档

README

Convert your .NET resource files to Laravel language files

Instalation

The first step is to install the package through Composer, for that require "itx-technologies/artisan-resx-to-lang" in your composer.json file

  "require-dev": {
    "itx-technologies/artisan-resx-to-lang": "~2.0"
  }

Then update composer from the command line

	composer update --dev

And finally add the following to the providers array of the /app/config/app.php file

	'ItxTechnologies\ArtisanResxToLang\ArtisanResxToLangServiceProvider',

You can then call php artisan to see the installed resxToLang command

Usage

First of all, make sure that the folders for every language you are trying to convert are present in your /app/lang directory. Then, make sure that the base language, the one in the flat [name].resx files, is set as your fallback locale in /app/config/app.php. Finally, transfer your .resx files in a folder called resx in your public folder. When that is done, simply call the command from the command line:

	php artisan resxToLang [filename]

When entering the filename, don't add the .resx.

The command will do it's magic, once it's finished, you can open your app/lang/[locale] folder and see a file named [filename].php that includes every string from your original resx file. In the other locale folders, you will see the same php file containing the same strings in that language.

Translating locale lines from C# to Laravel

if you used the razor templating engine in your original C# project, the translation is really fast. A line that looked like this:

	@Resources.File.String

becomes:

	@lang('file.String')

in a blade file or:

	echo Lang::get('file.String');

in a php block.

Please note that the file names are all lowercased during the conversion but not the string name

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固