• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

halfbaked/grails-localizations: grails plugin

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

halfbaked/grails-localizations

开源软件地址(OpenSource Url):

https://github.com/halfbaked/grails-localizations

开源编程语言(OpenSource Language):

Groovy 86.4%

开源软件介绍(OpenSource Introduction):

grails-localization

The localizations plugin alters Grails to use the database as its means of internationalization rather than message bundles (property files) in the i18n directory of your application. All property files in the i18n directory of your application (but not subdirectories of i18n) are automatically loaded in to the database the first time a message is requested after the plugin is installed.

##Installation

Add dependency to your build.gradle for > Grails 3.2.x:

repositories {
  ...
  maven { url "http://dl.bintray.com/sachinverma/plugins" }
}

dependencies {
    compile 'org.grails.plugins:grails-localizations:0.1.3'
}

Add dependency to your BuildConfig.groovy for Grails 2.x:

plugins {
        compile ":localizations:2.4"
}

Source Code for Grails 2.x: https://github.com/vsachinv/grails-localizations/tree/Plugin_2.X

####Enhancement for > Grails 3.2.x

You can enable/disable the localization value from DB using following configurations in application.groovy or application.yml

grails.plugin.localizations.enabled = true

Importing

There is also an import facility (at a URL similar to http://myServer/myApp/localization/imports) to load subsequently created property files - often the result of later installation of plugins. A 'message' method is added to all domain classes and service classes as a convenience. An 'errorMessage' method is added to all domain classes that can set an error message on either the domain as a whole or on a particular property of the domain.

CRUD

A localizations controller and CRUD screens are included with the plugin. The screens assume you are using a layout called main. Your database must be configured to allow the use of Unicode data for this plugin to work.

Caching

Localizations are cached for speed. You can reset the cache by going to http://myServer/myApp/localization/cache




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap