zooxsmart/los-i18n
Composer 安装命令:
composer require zooxsmart/los-i18n
包简介
I18N middleware providing route and country, region and language lists in all languages
README 文档
README
Introduction
This middleware provides list of Languages, Countries and Regions translated to all languages.
Requirements
PHP 7.4 | 8.0 and any container-interopt compatible project.
Installation
composer require zooxsmart/los-i18n
Optionally, copy the config file to your project.
I18n Data
This module needs data from los-i18n-data. So you need either to add the module to you project:
Adding the los-i18n-data
composer require zooxsmart/los-i18n-data
File format
There are 3 formats: php, json and csv. If you need to import the json file, it's located: vendor/zooxsmart/los-i18n-data/data//languages.json vendor/zooxsmart/los-i18n-data/data//countries.json vendor/zooxsmart/los-i18n-data/data//regions.json
Usage
Language list
$languagesService = $sm->get('losi18n-countries'); // All languages translated to pt_BR $languages = $countriesService->getAllLanguages('pt_BR'); // All languages in their native names $languages = $countriesService->getNativeLanguages(); // Brazilian Portuguese in English $language = $countriesService->getLanguage('pt_BR', 'en);
Country list
$countriesService = $sm->get('losi18n-countries'); // All officially assigned countries translated to English $countries = $countriesService->getAllCountries('en'); // All countries translated to English $countries = $countriesService->getAllCountries('en', false); // United States translated to Brazilian Portuguese $country = $countriesService->getCountry('US','pt_BR');
Region list
$regionsService = $sm->get('losi18n-regions'); $regions = $countriesService->getAllRegions('pt_BR');
zooxsmart/los-i18n 适用场景与选型建议
zooxsmart/los-i18n 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.97k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 10 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「i18n」 「language」 「country」 「los」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zooxsmart/los-i18n 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zooxsmart/los-i18n 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zooxsmart/los-i18n 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Easy to use i18n translation PHP class for multi-language websites
Package for convenient work with Laravel's localization features
Store your language lines in the database, yaml or other sources
A custom URL rule class for Yii 2 which allows to create translated URL rules
Sun Country is the package that helps you to get the country name & dialing code by the country ISO 3166-1 Alpha-2 code.
统计信息
- 总下载量: 11.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 37
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-31