Skip to content

Commit 4e20f31

Browse files
authored
Use en locale and include core fix for help text (#233)
1 parent 6ac933b commit 4e20f31

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<properties>
3535
<changelist>999999-SNAPSHOT</changelist>
3636
<gitHubRepo>jenkinsci/locale-plugin</gitHubRepo>
37-
<jenkins.version>2.452.1</jenkins.version>
37+
<jenkins.version>2.452.3</jenkins.version>
3838
<configuration-as-code.version>1810.v9b_c30a_249a_4c</configuration-as-code.version>
3939
<spotless.check.skip>false</spotless.check.skip>
4040
</properties>

src/main/java/hudson/plugins/locale/PluginImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class PluginImpl extends GlobalConfiguration {
4141

4242
// Set of allowed locales
4343
private static final Set<String> ALLOWED_LOCALES = new HashSet<>(Arrays.asList(
44-
"bg", "ca", "cs", "da", "de", "el", "en_GB", "es", "es_AR", "et", "fi", "fr", "he", "hu", "it", "ja", "ko",
44+
"bg", "ca", "cs", "da", "de", "el", "en", "es", "es_AR", "et", "fi", "fr", "he", "hu", "it", "ja", "ko",
4545
"lt", "lv", "nb_NO", "nl", "pl", "pt_BR", "pt_PT", "ro", "ru", "sk", "sl", "sr", "sv_SE", "tr", "uk",
4646
"zh_CN", "zh_TW"));
4747

@@ -170,9 +170,9 @@ public GlobalConfigurationCategory getCategory() {
170170
public ListBoxModel doFillSystemLocaleItems() {
171171
ListBoxModel items = new ListBoxModel();
172172

173-
// Use originalLocale to display the "Use Browser Locale" option
173+
// Use originalLocale to display the "Use Default Locale" option
174174
String originalLocaleDisplay = String.format(
175-
"Use Browser Locale - %s (%s)", originalLocale.getDisplayName(), originalLocale.toString());
175+
"Use Default Locale - %s (%s)", originalLocale.getDisplayName(), originalLocale.toString());
176176
items.add(new ListBoxModel.Option(originalLocaleDisplay, USE_BROWSER_LOCALE));
177177

178178
Locale[] availableLocales = Locale.getAvailableLocales();

src/test/java/hudson/plugins/locale/PluginImplTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void setUp() {
2828

2929
// Set of allowed locales for the test
3030
private static final Set<String> ALLOWED_LOCALES = new HashSet<>(Arrays.asList(
31-
"bg", "ca", "cs", "da", "de", "el", "en_GB", "es", "es_AR", "et", "fi", "fr", "he", "hu", "it", "ja", "ko",
31+
"bg", "ca", "cs", "da", "de", "el", "en", "es", "es_AR", "et", "fi", "fr", "he", "hu", "it", "ja", "ko",
3232
"lt", "lv", "nb_NO", "nl", "pl", "pt_BR", "pt_PT", "ro", "ru", "sk", "sl", "sr", "sv_SE", "tr", "uk",
3333
"zh_CN", "zh_TW"));
3434

@@ -38,24 +38,24 @@ public void testDoFillSystemLocaleItems() {
3838
ListBoxModel model = plugin.doFillSystemLocaleItems();
3939

4040
// Expected size of the ListBoxModel
41-
int expectedSize = ALLOWED_LOCALES.size() + 1; // +1 for the "Use Browser Locale" option
41+
int expectedSize = ALLOWED_LOCALES.size() + 1; // +1 for the "Use Default Locale" option
4242

4343
// Verify the returned ListBoxModel size
4444
assertEquals("The returned ListBoxModel size is not as expected", expectedSize, model.size());
4545

46-
// Verify that the first option is "Use Browser Locale"
46+
// Verify that the first option is "Use Default Locale"
4747
String expectedFirstOption = String.format(
48-
"Use Browser Locale - %s (%s)",
48+
"Use Default Locale - %s (%s)",
4949
Locale.getDefault().getDisplayName(), Locale.getDefault().toString());
50-
assertEquals("The first option should be 'Use Browser Locale'", expectedFirstOption, model.get(0).name);
50+
assertEquals("The first option should be 'Use Default Locale'", expectedFirstOption, model.get(0).name);
5151

5252
// Verify that the allowed locales are correctly added to the ListBoxModel, excluding the first option
5353
for (String localeStr : ALLOWED_LOCALES) {
5454
Locale locale = Locale.forLanguageTag(localeStr.replace('_', '-'));
5555
String expectedOption = String.format("%s - %s", locale.getDisplayName(), locale.toString());
5656

5757
boolean found = false;
58-
for (int i = 1; i < model.size(); i++) { // Start from 1 to skip the "Use Browser Locale" option
58+
for (int i = 1; i < model.size(); i++) { // Start from 1 to skip the "Use Default Locale" option
5959
if (model.get(i).name.equals(expectedOption)) {
6060
found = true;
6161
break;

0 commit comments

Comments
 (0)