Created
July 23, 2013 00:27
-
-
Save sergiomichels/6058890 to your computer and use it in GitHub Desktop.
Message source that you can use to get all message keys (including plugins)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // src/groovy folder | |
| package com.wordpress.sergiosmind.i18n | |
| import org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource | |
| class ExposedKeysMessageSource extends PluginAwareResourceBundleMessageSource { | |
| Set getAllKeys(Locale locale) { | |
| Set applicationKeys = getMergedProperties(locale).getProperties().keySet() | |
| Set pluginsKeys = getMergedPluginProperties(locale).getProperties().keySet() | |
| Set resultSet = [] as Set | |
| resultSet.addAll(applicationKeys) | |
| resultSet.addAll(pluginsKeys) | |
| return resultSet | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment