mireiawen/translation 问题修复 & 功能扩展

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

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

mireiawen/translation

Composer 安装命令:

composer require mireiawen/translation

包简介

Sets up the text translation domain and other settings for gettext translations

README 文档

README

Helper class to set up the text translation domain and other settings for gettext translations

  • Class name: Translation
  • Namespace: Mireiawen\Translation

Requirements

  • Intl extension
  • PHP 7

Installation

You can clone or download the code from the GitHub repository or you can use composer: composer require mireiawen/translation

Methods

__construct

Translation::__construct(string $path, string $default_language, string $domain, string $codeset = 'UTF-8')

Set up the translation and try to detect the user settings

Arguments

  • string $path - The filesystem path to the translations
  • string $default_language - The default language to use, if none can be determined
  • string $domain - The text domain to bind to
  • string $codeset - The character set to use with the translation file

Exceptions thrown

\Exception
  • In case the extension is missing
  • In case the translation folder does not exist
  • In case the language cannot be determined

GetLanguage

Translation::GetLanguage()

Get the user's currently selected language

Return value

  • string - The current language code

TranslateTo

Translation::TranslateTo(string $language, string $domain, string $codeset = 'UTF-8')

Set up the environment to load the correct translation file for the chosen language

Arguments

  • string $language - The language to load
  • string $domain - The text domain to bind to
  • string $codeset - The character set to use with the translation file

Exceptions thrown

\Exception
  • In case the language is empty

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固