public final class I18nMatchers extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertAllBundlesUpToDate()
Must be used only by independent plugins that embeds their own bundles for every language.
|
static void |
assertAllBundlesUpToDate(String sonarVersion,
Map<String,String> pluginIdsToBundleUrlMap)
Must be used only by language packs.
|
static BundleSynchronizedMatcher |
isBundleUpToDate()
Used only by independent plugins that embeds their own bundles for every language.
|
static BundleSynchronizedMatcher |
isBundleUpToDate(String sonarVersion)
Used by language packs that translate Core bundles.
|
static BundleSynchronizedMatcher |
isBundleUpToDate(URI referenceEnglishBundleURI)
Used by language packs that translate third-party bundles.
|
public static BundleSynchronizedMatcher isBundleUpToDate(String sonarVersion)
Used by language packs that translate Core bundles.
Returns a matcher which checks that a translation bundle is up to date with the corresponding English Core bundle.sonarVersion
- the version of the bundle to check against, or NULL to check against the latest source on GitHubpublic static BundleSynchronizedMatcher isBundleUpToDate(URI referenceEnglishBundleURI)
Used by language packs that translate third-party bundles.
Returns a matcher which checks that a translation bundle is up to date with the given reference English bundle from a third-party plugin.referenceEnglishBundleURI
- the URI referencing the English bundle to check againstpublic static BundleSynchronizedMatcher isBundleUpToDate()
Used only by independent plugins that embeds their own bundles for every language.
Returns a matcher which checks that a translation bundle is up to date with the corresponding default one found in the same folder.public static void assertAllBundlesUpToDate()
Must be used only by independent plugins that embeds their own bundles for every language.
Checks that all the translation bundles found on the classpath are up to date with the corresponding default one found in the same folder.public static void assertAllBundlesUpToDate(String sonarVersion, Map<String,String> pluginIdsToBundleUrlMap) throws URISyntaxException
Must be used only by language packs.
Depending on the parameters, this method does the following:
The following example will check that the translation of the Core bundles are up to date with version 3.2 of Sonar English Language Pack, and it
will also check that the translation of the bundle of the Web plugin is up to date with the reference English bundle of version 1.2 of the Web plugin:
MappluginIdsToBundleUrlMap = Maps.newHashMap(); pluginIdsToBundleUrlMap.put("web", "http://svn.codehaus.org/sonar-plugins/tags/sonar-web-plugin-1.2/src/main/resources/org/sonar/l10n/web.properties"); assertAllBundlesUpToDate("3.2", pluginIdsToBundleUrlMap);
sonarVersion
- the version of the bundles to check against, or NULL to check against the latest source on GitHubpluginIdsToBundleUrlMap
- a map that gives, for a given plugin, the URL of the English bundle that must be used to check the translation.URISyntaxException
- if the provided URLs in the "pluginIdsToBundleUrlMap" parameter are not correctCopyright © 2009-2012 SonarSource. All Rights Reserved.