承接 zooxsmart/los-i18n 相关项目开发

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

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

zooxsmart/los-i18n

最新稳定版本:1.0.2

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');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-31