承接 chinleung/verbose-localization 相关项目开发

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

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

chinleung/verbose-localization

最新稳定版本:v1.0.0

Composer 安装命令:

composer require chinleung/verbose-localization

包简介

A package to allow your class to support verbose localization.

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

A package to allow your class to support verbose localization.

Installation

You can install the package via composer:

composer require chinleung/verbose-localization

Usage

Add the ChinLeung\VerboseLocalization\HasVerboseLocalization trait to your class and create a method getTranslationIn(string $locale) to handle the translation of your class and get access to all the verbose methods instantly like the following example.

Suppose you have files with the translation of the text equivalent of numbers:

<?php

class NumberClass
{
    use ChinLeung\VerboseLocalization\HasVerboseLocalization;

    /**
     * Constructor of the class.
     *
     * @param  int  $value
     */
    public function __construct(int $value)
    {
        $this->value = $value;
    }

    /**
     * Retrieve the translation in a specific locale.
     *
     * @param  string  $locale
     * @return string
     */
    public function getTranslationIn(string $locale) : string
    {
        $translations = require __DIR__."/resources/lang/$locale/numbers.php";

        return $translations[$this->value];
    }
}

Then you can retrieve the translations like this:

$number = new NumberClass(1);

$number->inFrench(); // 'un'
$number->inEnglish(); // 'one'
$number->inSimplifiedChinese(); // '一'

Methods

The methods are seperated by language families which are located in src/Concerns.

Afro-Asiatic

View Methods
  • inAmharic
  • inArabic
  • inHausa
  • inHebrew
  • inMaltese
  • inSomali

Austronesian

View Methods
  • inCebuano
  • inFilipino
  • inHawaiian
  • inJavanese
  • inKhmer
  • inMalagasy
  • inMalay

Dravidian

View Methods
  • inKannada
  • inMalayalam
  • inTamil
  • inTelugu

French Creole

View Methods
  • inHaitianCreole

Hmong-Mien

View Methods
  • inHmong

Indo-European

View Methods
  • inAlbanian
  • inArmenian
  • inGreek

Balto-Slavic

View Methods
  • inBelarusian
  • inBosnian
  • inBulgarian
  • inCroatian
  • inCzech
  • inLatvian
  • inLithuanian
  • inMacedonian
  • inPolish
  • inRussian
  • inSerbian
  • inSlovak
  • inSlovenian
  • inUkrainian

Celtic

View Methods
  • inIrish
  • inScotsGaelic
  • inWelsh

Germanic

View Methods
  • inAfrikaans
  • inDanish
  • inDutch
  • inEnglish
  • inFrisian
  • inGerman
  • inIcelandic
  • inLuxembourgish
  • inNorwegian
  • inSwedish
  • inYiddish

Indo-Iranian

View Methods
  • inBengali
  • inGujarati
  • inHindi
  • inKurmanjiKurdish
  • inMarathi
  • inNepali
  • inPashto
  • inPersian
  • inPunjabi
  • inSindhi
  • inSinhala
  • inTajik
  • inUrdu

Italic

View Methods
  • inCatalan
  • inCorsican
  • inFrench
  • inGalician
  • inItalian
  • inLatin
  • inPortuguese
  • inRomanian
  • inSpanish

Isolate

View Methods
  • inBasque
  • inEsperanto

Japonic

View Methods
  • inJapanese

Kartvelian

View Methods
  • inGeorgian

Koreanic

View Methods
  • inKorean

Kra-Dai

View Methods
  • inLao
  • inThai

Monogolic

View Methods
  • Mongolian

Niger-Congo

View Methods
  • inChewa
  • inChichewa
  • inIgbo
  • inSesotho
  • inShona
  • inSwahili
  • inXhosa
  • inYoruba
  • inZulu

Sino-Tibetan

View Methods
  • inBurmeseMyanmar
  • inSimplifiedChinese
  • inTraditionalChinese

Turkic

View Methods
  • inAzerbaijani
  • inKazakh
  • inKyrgyz
  • inTurkish
  • inUzbek

Uralic

View Methods
  • inEstonian
  • inFinnish
  • inHungarian

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@chinleung.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固