Skip to content

Commit

Permalink
FIX JENKINS-43554 : Added internationalization support
Browse files Browse the repository at this point in the history
-created webapp folder with an empty README.md
-created required .properties files for internationalization
-added key/value pairs to .properties files
-modified .jelly view files to use the keys from their associated properties files
-internationalized the build step as well and updated the Builder class
accordingly
-important: plugin manager installed index.jelly is NOT localizable,
neither is the available or updates since they come from the wiki
  • Loading branch information
JordanGS committed Apr 13, 2017
1 parent 1d55f02 commit 7619c72
Show file tree
Hide file tree
Showing 13 changed files with 235 additions and 109 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jenkinsci/plugins/zap/ZAPBuilder.java
Expand Up @@ -383,7 +383,7 @@ public static final class ZAPBuilderDescriptorImpl extends BuildStepDescriptor<B

/* This human readable name is used in the configuration screen. */
@Override
public String getDisplayName() { return "Execute ZAP"; }
public String getDisplayName() { return Messages.jenkins_jobconfig_addbuildstep_zap(); }

@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
Expand Down
@@ -0,0 +1 @@
jenkins.jobconfig.addbuildstep.zap=Execute ZAP
Expand Up @@ -27,8 +27,8 @@ SOFTWARE.
<f:entry help="/descriptor/org.jenkinsci.plugins.zap.ZAPAuthScriptParam/help/config">
<table width="100%">
<tr>
<th>${%Script Parameter Name}</th>
<th>${%Script Parameter Value}</th>
<th>${%jenkins.jobconfig.zap.session.properties.context.authentication.script-based.nameparam.textbox.label}</th>
<th>${%jenkins.jobconfig.zap.session.properties.context.authentication.script-based.valueparam.textbox.label}</th>
</tr>
<tr>
<td><f:textbox field="scriptParameterName"/></td>
Expand Down
@@ -0,0 +1,2 @@
jenkins.jobconfig.zap.session.properties.context.authentication.script-based.nameparam.textbox.label=Script Parameter Name
jenkins.jobconfig.zap.session.properties.context.authentication.script-based.valueparam.textbox.label=Script Parameter Value
Expand Up @@ -26,24 +26,24 @@ SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<!-- This jelly script is used for per-project configuration. See global.jelly for a general discussion about jelly script. -->

<f:section title="${%Admin Configurations}">
<f:entry title="${%Workspace}">
<f:section title="${%jenkins.jobconfig.zap.defaultoverride.section.label}">
<f:entry title="${%jenkins.jobconfig.zap.workspace.label}">
${it.workspace}
</f:entry>

<f:entry title=""></f:entry>

<f:entry title="${%Override Host}" field="zapHost" description="Default Host is : ${descriptor.zapDefaultHost} (${%Configured under 'Manage Jenkins' > 'Configure System'})">
<f:entry title="${%jenkins.jobconfig.zap.defaultoverride.host.textbox.label}" field="zapHost" description="${%jenkins.jobconfig.zap.defaultoverride.host.textbox.description(descriptor.zapDefaultHost)}">
<f:textbox clazz="required" default="${descriptor.zapDefaultHost}" />
</f:entry>

<f:entry title="${%Override Port}" field="zapPort" description="Default Port is : ${descriptor.zapDefaultPort} (${%Configured under 'Manage Jenkins' > 'Configure System'})">
<f:entry title="${%jenkins.jobconfig.zap.defaultoverride.port.textbox.label}" field="zapPort" description="${%jenkins.jobconfig.zap.defaultoverride.port.textbox.description(descriptor.zapDefaultPort)}">
<f:textbox default="${descriptor.zapDefaultPort}" clazz="required" />
</f:entry>
</f:section>

<f:section title="${%Startup}" />
<f:optionalBlock title="${%Run as Pre-Build Step}" field="startZAPFirst" inline="true" />
<f:section title="${%jenkins.jobconfig.zap.startup.section.label}" />
<f:optionalBlock title="${%jenkins.jobconfig.zap.startup.selenium.checkbox.label}" field="startZAPFirst" inline="true" />
<!-- Load the config.jelly bind to ZAPDriver class. This code doesn't work : <st:include page="config.jelly" class="com.github.jenkinsci.zaproxyplugin.ZAPDriver"/>. It doesn't create an ZAPDriver. Use f:property instead. -->
<f:property field="zaproxy" />
</j:jelly>
@@ -0,0 +1,8 @@
jenkins.jobconfig.zap.defaultoverride.section.label=Admin Configurations
jenkins.jobconfig.zap.workspace.label=Workspace
jenkins.jobconfig.zap.defaultoverride.host.textbox.label=Override Host
jenkins.jobconfig.zap.defaultoverride.host.textbox.description=Default Host is : {0} (Configured under 'Manage Jenkins' > 'Configure System')
jenkins.jobconfig.zap.defaultoverride.port.textbox.label=Override Port
jenkins.jobconfig.zap.defaultoverride.port.textbox.description=Default Port is : {0} (Configured under 'Manage Jenkins' > 'Configure System')
jenkins.jobconfig.zap.startup.section.label=Startup
jenkins.jobconfig.zap.startup.selenium.checkbox.label=Run as Pre-Build Step
Expand Up @@ -36,25 +36,25 @@ SOFTWARE.
tags they use. Views are always organized according to its owner class,
so it should be straightforward to find them.
-->
<f:section title="ZAP">
<f:entry title="${%Default Host}" field="zapDefaultHost">
<f:section title="${%jenkins.systemconfig.zap.default.section.label}">
<f:entry title="${%jenkins.systemconfig.zap.default.host.textbox.label}" field="zapDefaultHost">
<f:textbox default="localhost" clazz="required" />
</f:entry>

<f:entry title="${%Default Port}" field="zapDefaultPort">
<f:entry title="${%jenkins.systemconfig.zap.default.port.textbox.label}" field="zapDefaultPort">
<f:textbox default="8090" clazz="required" />
</f:entry>
</f:section>
<f:section title="ZAP JIRA">
<f:entry title="${%JIRA Base Url}" field="jiraBaseURL">
<f:section title="${%jenkins.systemconfig.zap.jira.section.label}">
<f:entry title="${%jenkins.systemconfig.zap.jira.baseurl.textbox.label}" field="jiraBaseURL">
<f:textbox default="" />
</f:entry>

<f:entry title="${%Username}" field="jiraUsername">
<f:entry title="${%jenkins.systemconfig.zap.jira.username.textbox.label}" field="jiraUsername">
<f:textbox default="" />
</f:entry>

<f:entry title="${%Password}" field="jiraPassword">
<f:entry title="${%jenkins.systemconfig.zap.jira.password.textbox.label}" field="jiraPassword">
<f:password default="" />
</f:entry>
</f:section>
Expand Down
@@ -0,0 +1,7 @@
jenkins.systemconfig.zap.default.section.label=ZAP
jenkins.systemconfig.zap.default.host.textbox.label=Default Host
jenkins.systemconfig.zap.default.port.textbox.label=Default Port
jenkins.systemconfig.zap.jira.section.label=ZAP JIRA
jenkins.systemconfig.zap.jira.baseurl.textbox.label=JIRA Base URL
jenkins.systemconfig.zap.jira.username.textbox.label=Username
jenkins.systemconfig.zap.jira.password.textbox.label=Password
Expand Up @@ -27,8 +27,8 @@ SOFTWARE.
<f:entry help="/descriptor/org.jenkinsci.plugins.zap.ZAPCmdLine/help/config">
<table width="100%">
<tr>
<th>${%Command line option}</th>
<th>${%Command line value}</th>
<th>${%jenkins.jobconfig.zap.config.cmdlineargs.optionarg.textbox.label}</th>
<th>${%jenkins.jobconfig.zap.config.cmdlineargs.valuearg.textbox.label}</th>
</tr>
<tr>
<td><f:textbox field="cmdLineOption"/></td>
Expand Down
@@ -0,0 +1,2 @@
jenkins.jobconfig.zap.config.cmdlineargs.optionarg.textbox.label=Command Line Option
jenkins.jobconfig.zap.config.cmdlineargs.valuearg.textbox.label=Command Line Value

0 comments on commit 7619c72

Please sign in to comment.