Skip to content

Commit 796fd6a

Browse files
committed
Fix tabs, tidy up, refine content
1 parent 13e89f8 commit 796fd6a

File tree

12 files changed

+35
-39
lines changed

12 files changed

+35
-39
lines changed

src/main/resources/io/jenkins/plugins/designlibrary/Localization/index.jelly

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,11 @@ THE SOFTWARE.
2424
<?jelly escape-by-default='true'?>
2525
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:s="/lib/samples">
2626
<s:layout>
27-
<s:section title="${%titlejava}" description="${%howtojava}">
28-
<s:group>
29-
<s:preview fullWidth="true">
30-
<f:entry>
31-
${it.message}<br/>
32-
${it.greet}
33-
</f:entry>
34-
</s:preview>
35-
<s:code-panes>
36-
<s:code-pane title="Localize.java">
37-
<s:code language="java" file="Localize.java"/>
38-
</s:code-pane>
39-
<s:code-pane title="Messages.properties">
40-
<s:code file="Messages.properties"/>
41-
</s:code-pane>
42-
<s:code-pane title="Messages_de.properties">
43-
<s:code file="Messages_de.properties"/>
44-
</s:code-pane>
45-
</s:code-panes>
46-
</s:group>
47-
</s:section>
4827
<s:section title="${%titlejelly}" description="${%howtojelly}">
4928
<s:group>
5029
<s:preview fullWidth="true">
5130
<f:entry>
52-
${%How to localize texts in Jelly}<br/>
53-
${%longtext}<br/>
31+
${%longtext}<br/><br/>
5432
${%hello('World')}
5533
</f:entry>
5634
</s:preview>
@@ -67,6 +45,19 @@ THE SOFTWARE.
6745
</s:code-panes>
6846
</s:group>
6947
</s:section>
48+
<s:section title="${%titlejava}" description="${%howtojava}">
49+
<s:code-panes>
50+
<s:code-pane title="Localize.java">
51+
<s:code language="java" file="Localize.java"/>
52+
</s:code-pane>
53+
<s:code-pane title="Messages.properties">
54+
<s:code file="Messages.properties"/>
55+
</s:code-pane>
56+
<s:code-pane title="Messages_de.properties">
57+
<s:code file="Messages_de.properties"/>
58+
</s:code-pane>
59+
</s:code-panes>
60+
</s:section>
7061
<s:section title="${%titlejsJelly}" description="${%howtojsJelly}">
7162
<s:code-panes>
7263
<s:code-pane title="localize.jelly">

src/main/resources/io/jenkins/plugins/designlibrary/Localization/index.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ howtojava=Create a file <em>Messages.properties</em> in the package folder. Afte
33
hello=Hello {0}
44
titlejelly=Localize text in Jelly
55
howtojelly=Use <em>$&#123;%Text}</em> to create texts that can be localized. Create a properties files for content longer than a few words.
6-
longtext=A longer text that should not appear inline in the jelly file.
6+
longtext=A longer text that should not appear inline in the Jelly file.
77

88
titlejsJelly=Localize text in JavaScript via Jelly
9-
howtojsJelly=Attach the localizations in attributes of template HTML elements via jelly which can then be retrieved via the document.
9+
howtojsJelly=Attach the localizations in attributes of template HTML elements via Jelly which can then be retrieved via the document.
1010
titlejsHTTP=Localize text in JavaScript via HTTP
11-
howtojsHTTP=Load them over HTTP via an endpoint <br/><code>$JENKINS_URL/i18n/resourceBundle?baseName=package.path.to.property.file</code><br/> which retrieves the property file in the users' locale. \
11+
howtojsHTTP=Load them over HTTP via <code>$JENKINS_URL/i18n/resourceBundle?baseName=package.path.to.property.file</code> which retrieves the property file in the users' locale. \
1212
This returns a JSON object with the localized texts.
1313
14-
moreInfo=A detailed explanation how to localize texts in Java and Jelly files can be found in the developer guide <a href="https://www.jenkins.io/doc/developer/internationalization/" target="_blank">Internationalization and Localization</a>.
14+
moreInfo=A detailed explanation on how to localize text in Java and Jelly files can be found in the developer guide <a href="https://www.jenkins.io/doc/developer/internationalization/" target="_blank">Internationalization and Localization</a>.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Localization.description=Ensures texts can be displayed in the user''s language.
2-
Localization.message=How to localize texts in Java
2+
Localization.message=How to localize text in Java
33
Localization.greet=Hello {0}

src/main/resources/scss/components/_component-group.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
border-bottom-right-radius: 0;
66
}
77

8-
.jdl-component-code {
8+
.jdl-component-code__tab-bar, .jdl-component-code {
99
margin-top: 0;
1010
border-top-left-radius: 0;
1111
border-top-right-radius: 0;

src/main/resources/scss/components/_source-block.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ $jdl-component-code-controls-spacing: 0.75rem;
4545

4646
&__tab-bar {
4747
background: var(--card-background);
48+
border-top: var(--jenkins-border);
4849
border-left: var(--jenkins-border);
4950
border-right: var(--jenkins-border);
51+
border-top-left-radius: 0.66rem;
52+
border-top-right-radius: 0.66rem;
5053
display: flex;
5154
flex-wrap: wrap;
5255
gap: 0.9rem;
@@ -115,6 +118,16 @@ $jdl-component-code-controls-spacing: 0.75rem;
115118
}
116119
}
117120

121+
.jdl-tab-panes {
122+
.jdl-component-code {
123+
margin-top: 0;
124+
border-top-left-radius: 0;
125+
border-top-right-radius: 0;
126+
margin-bottom: 0;
127+
border-top: none;
128+
}
129+
}
130+
118131
.jdl-tab-pane__text {
119132
padding: 0 1em 1em 1em;
120133
border-left: var(--jenkins-border);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Localize.message=How to localize texts in Java
1+
Localize.message=How to localize text in Java
22
Localize.greet=Hello {0}

src/main/webapp/Localization/localize-http.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ const response = await fetch(
44
const json = await response.json();
55
const i18n = json.data;
66

7-
const localization = i18n["How to localize texts in Jelly"];
87
const longText = i18n.longtext;
98
const hello = i18n.hello;
109

11-
console.log(localization);
1210
console.log(longText);
1311
console.log(hello.replace("{0}", "World!"));
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const i18n = document.getElementById("plugin-i18n");
22

3-
const localization = i18n.dataset.localization;
43
const longText = i18n.dataset.longtext;
54
const hello = i18n.dataset.hello;
65

7-
console.log(localization);
86
console.log(longText);
97
console.log(hello.replace("{0}", "World!"));

src/main/webapp/Localization/localize-js.jelly

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<j:jelly xmlns:j="jelly:core">
33
<template
44
id="plugin-i18n"
5-
data-localization="${%How to localize texts in Jelly}"
65
data-longtext="${%longtext}"
76
data-hello="${%hello}"
87
/>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?jelly escape-by-default='true'?>
22
<j:jelly xmlns:j="jelly:core">
3-
${%How to localize texts in Jelly}
43
${%longtext}
54
${%hello('World')}
65
</j:jelly>

0 commit comments

Comments
 (0)