jrmajor/pluralrules 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jrmajor/pluralrules

最新稳定版本:v1.2.0

Composer 安装命令:

composer require jrmajor/pluralrules

包简介

Identify plural categories according to CLDR

README 文档

README

Latest Stable Version Required PHP Version

A PHP package for identifying the plural category, according to CLDR, for a given number.

Major\PluralRules\PluralRules::select('en', 1);   // 'one'
Major\PluralRules\PluralRules::select('en', 2);   // 'other'
Major\PluralRules\PluralRules::select('pl', 1);   // 'one'
Major\PluralRules\PluralRules::select('pl', 42);  // 'few'
Major\PluralRules\PluralRules::select('pl', 45);  // 'many'
Major\PluralRules\PluralRules::select('pl', 1.5); // 'other'

You may install it via composer: composer require jrmajor/pluralrules.

Contributing

This package works by compiling CLDR plural rules to PHP closures like these. This is done by gen script (php gen rules and php gen tests). Before running it, you would need to run yarn install to download cldr-core package.

Testing

vendor/bin/phpunit           # Tests
vendor/bin/phpstan analyze   # Static analysis
vendor/bin/php-cs-fixer fix  # Formatting

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-01