承接 thetminnhtun/laravel-localization-js 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

thetminnhtun/laravel-localization-js

Composer 安装命令:

composer require thetminnhtun/laravel-localization-js

包简介

Laravel localization for JavaScript

README 文档

README

Issues Forks Stars

Laravel localization for JavaScript

Requirements

  1. PHP 7.0 or higher
  2. Laravel 6.0 or higher

Installation

composer require thetminnhtun/laravel-localization-js

Include the asset

<html>

<body>

    ...

    <x-tmh::laravel-localization-js />

</body>

</html>

Publish the asset file

php artisan vendor:publish --tag=localization-js

Usage

Create the language files what you want. For example, we will create english and myanmar.

/resources
    /lang
        en.json
        my.json

In en.json

{
    "Welcome": "Welcome",
    "Hello": "Hello :name"
}

In my.json

{
    "Welcome": "ကြိုဆိုပါတယ်။",
    "Hello": "မင်္ဂလာပါ :name။"
}

Getting a message from JavaScript

console.log(Lang.get('Welcome'));
console.log(Lang.get('Hello', {name: 'Mg Mg'}));

Ouput

// What if locale is `en`
Welcome
Hello Mg Mg

// or what if locale is `en`
ကြိုဆိုပါတယ်။
မင်္ဂလာပါ Mg Mg။

Avaliable another ways

Lang.get('Welcome');
__('Welcome');
trans('Welcome');

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固