molajo/language 问题修复 & 功能扩展

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

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

molajo/language

Composer 安装命令:

composer require molajo/language

包简介

Molajo Language Services for PHP Applications

README 文档

README

======= Language Package

Build Status

Language Services supporting translations for the User Interface for PHP applications using Adapters for different implementation types.

How to specify Language

Language strings are loaded in startup for language determined in this order (and installed):

  1. Injected value during class instantiation
  2. Session
  3. User Data
  4. Client Language
  5. Application Configuration
  6. Defaults to en-GB

Instantiation

To instantiate the Language Class:

   $language = new Language($language);

Once instantiated, all calls to the class can be made using the $language instance.

Language Properties

To retrieve the key value (ex. 'en-GB') for the language which is loaded:

   $language->get('language');

Retrieve Language Strings

To retrieve all language strings and translations for the loaded language:

   $language->get('strings');

Retrieve List of all installed Languages

To retrieve a list of all languages installed in this application:

   $language->get('installed');

Retrieve Language Attribute

To retrieve a registry attribute value (id, name, rtl, local, first_day) for the loaded language:

   $language->get('name-of-attribute');

Retrieve all Language Attributes

To retrieve all registry attribute values as an array for the loaded language:

   $language->get('registry');

Translate

To translate the string $xyz:

   $language->translate($xyz);

To retrieve a list of language strings and translations matching a wildcard value:

   $language->translate($xyz, 1);

Identify Untranslated Strings

To insert strings found in code but are not already in database:

  • If an administrator is logged on, the primary language services automatically insert untranslated strings
  • To avoid doing so, override the LanguagePlugin and set insert_missing_strings to 0
  • For instances you define, set the insert_missing_strings, as needed.

To log strings found in code, but are not already in database:

  • Set the Application configuration option profile_missing_strings to 1 and turn on profiling

Requirements and Compliance

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固