forked from aitortxu/grails-i18n-fields-plugin
/
I18nFieldsGrailsPlugin.groovy
47 lines (40 loc) · 1.33 KB
/
I18nFieldsGrailsPlugin.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import org.codehaus.groovy.grails.commons.*
import org.apache.log4j.Logger
import i18nfields.*
import grails.util.GrailsUtil
class I18nFieldsGrailsPlugin {
static final def log = Logger.getLogger(I18nFieldsGrailsPlugin)
def version = "0.6"
def grailsVersion = "1.3 > *"
def dependsOn = [:]
def pluginExcludes = [
"lib/*",
"grails-app/i18n/*",
"grails-app/domain/i18nfields/*",
"grails-app/controllers/i18nfields/*",
"grails-app/services/i18nfields/*",
"grails-app/taglib/i18nfields/*",
"grails-app/views/*",
"grails-app/views/layouts/*",
"web-app/css/*",
"web-app/images/*",
"web-app/images/skin/*",
"web-app/js/*",
"web-app/js/prototype/*",
]
def config = ConfigurationHolder.config
def author = "Jorge Uriarte"
def authorEmail = "jorge.uriarte@omelas.net"
def title = "i18n Fields"
def description = "This plugin provides an easy way of declarativily localize database fields of your content tables."
def documentation = "http://grails.org/plugin/i18n-fields"
def doWithDynamicMethods = { context ->
['controller', 'service', 'tagLib', 'codec', 'bootstrap'].each {
application."${it}Classes".each { theClass ->
// TODO: Use log4j
println "[i18nFields] Adding 'withLocale' method to ${theClass.name} ${it} Class"
theClass.metaClass.withLocale = I18nFieldsHelper.withLocale
}
}
}
}