承接 zeropanel/i18next-php 相关项目开发

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

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

zeropanel/i18next-php

最新稳定版本:v2.0.0

Composer 安装命令:

composer create-project zeropanel/i18next-php

包简介

A port of the i18next JS library for PHP

README 文档

README

A port of i18next in PHP. With a rest API. (coming soon [tm])

Code in this repository is largely based on the original code base in JavaScript, rewritten in PHP. This project focuses only on the newest version of i18next, disregarding compatibility with previous ones.

Warning!

This version is usable, but could contain bugs. If you find any issues please report them or create a PR.

Features

  • PSR3 logging support (psr/log is a hard requirement, but you're not required to actually use a logger)
  • Extremely similar API to the JS version
  • PHP-specific features like interfaces for modules
  • PHP 7.3+
  • Automatic language detection support

Usage

View all examples here

Basic example

// You can also use I18n globally via I18n::get()

$i18n = new I18n([
    'lng'           =>  'en',
    'resources'     =>  [
        'en'        =>  [
            'translation'       =>  [
                'key'           =>  'Value',
                'key_plural'    =>  'Value plural',
                'deeper'        =>  [
                    'key'           =>  'Deep value'
                ]
            ]
        ]
    ]
]);

$i18n->t('key'); // "Value"
$i18n->t('key', ['count' => 5]); // "Value plural"
$i18n->t('deeper.key'); // "Depp value"

Composer

Simply enter your project directory and run

composer require alpakaio/i18next-php

Todo

  • Add event emitting

Packagist

Visit the page here

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-17