+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <artifactId>sonar</artifactId>\r
- <groupId>org.codehaus.sonar</groupId>\r
- <version>2.9-SNAPSHOT</version>\r
- <relativePath>../..</relativePath>\r
- </parent>\r
- <groupId>org.codehaus.sonar.plugins</groupId>\r
- <artifactId>sonar-i18n-plugin</artifactId>\r
- <packaging>sonar-plugin</packaging>\r
- <version>2.9-SNAPSHOT</version>\r
- <name>Sonar :: Plugins :: I18n</name>\r
- <description>Sonar I18n plugin</description>\r
-\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.codehaus.sonar</groupId>\r
- <artifactId>sonar-plugin-api</artifactId>\r
- <scope>provided</scope>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.codehaus.sonar</groupId>\r
- <artifactId>sonar-core</artifactId>\r
- <scope>provided</scope>\r
- </dependency>\r
-\r
- <!-- unit tests -->\r
- <dependency>\r
- <groupId>org.codehaus.sonar</groupId>\r
- <artifactId>sonar-testing-harness</artifactId>\r
- <scope>test</scope>\r
- </dependency>\r
- <dependency>\r
- <groupId>junit</groupId>\r
- <artifactId>junit</artifactId>\r
- <scope>test</scope>\r
- </dependency>\r
- </dependencies>\r
-\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-compiler-plugin</artifactId>\r
- <version>2.0.2</version>\r
- <configuration>\r
- <source>1.5</source>\r
- <target>1.5</target>\r
- <encoding>UTF-8</encoding>\r
- </configuration>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.codehaus.sonar</groupId>\r
- <artifactId>sonar-packaging-maven-plugin</artifactId>\r
- <version>1.1</version>\r
- <extensions>true</extensions>\r
- <configuration>\r
- <pluginKey>i18n</pluginKey>\r
- <pluginClass>org.sonar.plugins.i18n.I18nPlugin</pluginClass>\r
- <pluginName>I18n</pluginName>\r
- <pluginDescription>\r
- <![CDATA[Provides components required to internationalize Sonar application and plugins, as well as a default language bundle for the Sonar kernel modules and web application.]]></pluginDescription>\r
- </configuration>\r
- </plugin>\r
- </plugins>\r
- </build>\r
-</project>\r
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.i18n;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.RubyRailsWebservice;
-
-public class I18nWebService extends AbstractRubyTemplate implements RubyRailsWebservice {
-
- public String getId() {
- return "i18n_manager";
- }
-
- @Override
- protected String getTemplatePath() {
- return "i18n_manager_controller.rb";
- }
-}
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# Sonar is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
-#
-
-require "json"
-
-class Api::I18nManagerController < Api::ApiController
-
- def index
- render :text => "Use one of the following:<br><ul>" +
- "<li>/api/plugins/i18n_manager/unknown_keys?format=text|json</li>" +
- "</ul>"
- end
-
- # GET /api/plugins/i18n_manager/unknown_keys
- # Examples :
- # curl -v http://localhost:9000/api/plugins/i18n_manager -u admin:admin
- #
-
- def unknown_keys
- begin
- output = ""
- properties = i18n_manager.unknown_keys
-
- properties.keys.sort.each {|key| output += "#{key}=#{properties[key]}\n" }
-
- output = "# No unknown keys" if output.empty?
-
- respond_to do |format|
- format.json { render :json => JSON(properties) }
- format.xml { render :xml => xml_not_supported }
- format.text { render :text => output }
- end
-
- rescue ApiException => e
- render_error(e.msg, e.code)
-
- rescue Exception => e
- logger.error("Fails to execute #{request.url} : #{e.message}")
- render_error(e.message)
- end
- end
-
- private
-
- def i18n_manager
- java_facade.getComponentByClassname('i18n', 'org.sonar.plugins.i18n.I18nManager')
- end
-
-end
\ No newline at end of file
require "json"
-class I18nController < Api::ApiController
+class I18nController < ApplicationController
def index
- render :text => "Use one of the following:<br><ul>" +
- "<li>/i18n/unknown_keys?format=text|json</li>" +
- "</ul>"
+ render :text => "Use one of the following:<br><ul>" +
+ "<li>/i18n/unknown_keys?format=text|json</li>" +
+ "</ul>"
end
#
# GET /i18n/unknown_keys
#
def unknown_keys
- begin
- output = ""
- properties = i18n_manager.unknown_keys
+ output = ""
+ properties = i18n_manager.unknown_keys
- properties.keys.sort.each {|key| output += "#{key}=#{properties[key]}\n" }
+ properties.keys.sort.each { |key| output += "#{key}=#{properties[key]}\n" }
- output = "# No unknown keys" if output.empty?
+ output = "# No unknown keys" if output.empty?
- respond_to do |format|
- format.json { render :json => JSON(properties) }
- format.xml { render :xml => xml_not_supported }
- format.text { render :text => output }
- end
-
- rescue ApiException => e
- render_error(e.msg, e.code)
-
- rescue Exception => e
- logger.error("Fails to execute #{request.url} : #{e.message}")
- render_error(e.message)
+ respond_to do |format|
+ format.json { render :json => JSON(properties) }
+ format.xml { render :xml => xml_not_supported }
+ format.text { render :text => output }
end
end
private
def i18n_manager
- java_facade.getComponentByClassname('i18n', 'org.sonar.plugins.core.i18n.I18nManager')
+ java_facade.getComponentByClassname('core', 'org.sonar.plugins.core.i18n.I18nManager')
end
end
\ No newline at end of file