richardsjoqvist/silverstripe-localdate 问题修复 & 功能扩展

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

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

richardsjoqvist/silverstripe-localdate

Composer 安装命令:

composer require richardsjoqvist/silverstripe-localdate

包简介

Translates formatted date strings to the locale set with i18n::set_locale() if there is a matching language file.

README 文档

README

LocalDate translates formatted date strings if there is a matching language file.

Requirements

  • SilverStripe 3.1 (this module will probably not be updated to SilverStripe 4)

Notes

Installation

  1. Drop the module into your SilverStripe project and run /dev/build
  2. Set the correct locale in your project _config.php using i18n::set_locale('xx_XX');

You may also set the language manually using LocalDateHelper::setLocale('xx_XX'); at any time.

Usage

The module will extend and override SS_Datetime and Date. Existing dates will be automatically translated as long as a valid language file exists as long as they are of SS_Datetime or Date type.

The locale for the translated date is based on (in order):

  1. Any valid locale set with the LocalDateHelper::setLocale('xx_XX');
  2. The current locale for Translatable if the module is installed
  3. The current i18n-setting

If the language file for your locale is missing you can easily create it yourself. Simply use one of the included language files as a template and save it to your /mysite/lang folder. Better yet, fork this repo and add it to the lang-folder and send me a pull request. Sending me an email (mailto:richard@spiro.se) with the translated file attached will also do the trick.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固