Skip to content

Commit

Permalink
[JENKINS-71866] Allow to use alternate values for "Build with Paramet…
Browse files Browse the repository at this point in the history
…ers" and the "Build" button on the parameters page (#8496)

[JENKINS-71866] alternate for Build with Parameters

Allow to use alternate values for "Build with Parameters" and the
"Build" button on the parameters page.
See also JENKINS-46554 and JENKINS-27214
  • Loading branch information
mawinter69 committed Sep 22, 2023
1 parent c8c7526 commit 2fc718d
Show file tree
Hide file tree
Showing 38 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import hudson.Util;
import hudson.model.Queue.WaitingItem;
import hudson.model.queue.ScheduleResult;
import hudson.util.AlternativeUiTextProvider;
import java.io.IOException;
import java.util.AbstractList;
import java.util.ArrayList;
Expand Down Expand Up @@ -72,6 +73,8 @@
public class ParametersDefinitionProperty extends OptionalJobProperty<Job<?, ?>>
implements Action {

public static final AlternativeUiTextProvider.Message<Job> BUILD_BUTTON_TEXT = new AlternativeUiTextProvider.Message<>();

private final List<ParameterDefinition> parameterDefinitions;

@DataBoundConstructor
Expand All @@ -87,6 +90,11 @@ private Object readResolve() {
return parameterDefinitions == null ? new ParametersDefinitionProperty() : this;
}


public final String getBuildButtonText() {
return AlternativeUiTextProvider.get(BUILD_BUTTON_TEXT, owner, Messages.ParametersDefinitionProperty_BuildButtonText());
}

@Deprecated
public AbstractProject<?, ?> getOwner() {
return (AbstractProject) owner;
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,14 @@ public static CauseAction getBuildCause(ParameterizedJob job, StaplerRequest req
* @since 1.624
*/
public static final AlternativeUiTextProvider.Message<ParameterizedJob> BUILD_NOW_TEXT = new AlternativeUiTextProvider.Message<>();
public static final AlternativeUiTextProvider.Message<ParameterizedJob> BUILD_WITH_PARAMETERS_TEXT = new AlternativeUiTextProvider.Message<>();

/**
* Suggested implementation of {@link ParameterizedJob#getBuildNowText}.
*/
public final String getBuildNowText() {
return isParameterized() ? AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_with_parameters())
return isParameterized() ? AlternativeUiTextProvider.get(BUILD_WITH_PARAMETERS_TEXT, asJob(),
AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_with_parameters()))
: AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_now());
}

Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/hudson/model/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ LabelExpression.NoMatch=No agent/cloud matches this label expression.
LabelExpression.NoMatch_DidYouMean=No agent/cloud matches this label expression. Did you mean ‘{1}’ instead of ‘{0}’?
ManageJenkinsAction.DisplayName=Manage Jenkins
MultiStageTimeSeries.EMPTY_STRING=
ParametersDefinitionProperty.BuildButtonText=Build
Queue.AllNodesOffline=All nodes of label ‘{0}’ are offline
Queue.LabelHasNoNodes=There are no nodes with the label ‘{0}’
Queue.BlockedBy=Blocked by ‘{0}’
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/hudson/model/Messages_bg.properties
Original file line number Diff line number Diff line change
Expand Up @@ -724,3 +724,5 @@ AbstractItem.BeingDeleted=\
# {0} has been removed from configuration
Queue.node_has_been_removed_from_configuration=\
„{0}“ е изтрит от настройките
ParametersDefinitionProperty.BuildButtonText=Изграждане

Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,4 @@ ManageJenkinsAction.DisplayName=Bestyr Jenkins
ParametersDefinitionProperty.DisplayName=Dette byg er parameteriseret
AbstractItem.NewNameInUse=Navnet {0} er allerede i brug
Job.NoRenameWhileBuilding=Kan ikke omdøbe et job imens det bygger
ParametersDefinitionProperty.BuildButtonText=Byg
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,4 @@ Computer.ConnectPermission.Description=Este permiso permite que los usuarios pue
BallColor.NotBuilt=Sin ejecutar.
AbstractBuild_Building=Ejecutando.
ParametersDefinitionProperty.DisplayName=Esta ejecución debe parametrizarse
ParametersDefinitionProperty.BuildButtonText=Ejecución
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
FreeStyleProject.Description=See on Jenkinsi põhifunktsioon! Jenkins ehitab su projekti, kombineerides sinu versioonihalduse mistahes ehitusprotsessiga. Sa võid seda kasutada ka muudeks asjadeks kui tarkvara ehitamine.
ParametersDefinitionProperty.BuildButtonText=Bild
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,4 @@ View.Permissions.Title=Visualizza
View.ReadPermission.Description=Questo permesso consente agli utenti di \
visualizzare le viste (è implicito se si dispone dell''accesso generico in \
lettura).
ParametersDefinitionProperty.BuildButtonText=Compilazione
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,4 @@ TimeZoneProperty.DisplayName=ユーザー設定タイムゾーン
TimeZoneProperty.DisplayDefaultTimeZone=デフォルト
TimeZoneProperty.current_time_in_=現在の設定 {0}: {1}
TimeZoneProperty.current_time_on_server_in_in_proposed_di=現在のサーバー時刻 {0}: {1}; 表示するゾーン: {2}
ParametersDefinitionProperty.BuildButtonText=ビルド
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ ManageJenkinsAction.DisplayName=Jenkins 관리
ParametersDefinitionProperty.DisplayName=이 빌드는 매개변수가 있습니다

FreeStyleProject.Description=이것은 Jenkins의 주요 기능입니다. Jenkins은 어느 빌드 시스템과 어떤 SCM(형상관리)으로 묶인 당신의 프로젝트를 빌드할 것이고, 소프트웨어 빌드보다 다른 어떤 것에 자주 사용될 수 있습니다.
ParametersDefinitionProperty.BuildButtonText=매개변수가 필요한 빌드입니다.
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Permalink.LastSuccessfulBuild=Laatste succesvolle bouwpoging
Permalink.LastFailedBuild=Laatst gefaalde bouwpoging
ManageJenkinsAction.DisplayName=Beheer Jenkins
ParametersDefinitionProperty.DisplayName=Deze bouwpoging is geparametriseerd
ParametersDefinitionProperty.BuildButtonText=Bouwen
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ ManagementLink.Category.TROUBLESHOOTING=Rozwiązywanie problemów
ManagementLink.Category.TOOLS=Narzędzia i akcje
ManagementLink.Category.MISC=Inne
ManagementLink.Category.UNCATEGORIZED=Nieskategoryzowane
ParametersDefinitionProperty.BuildButtonText=Buduj
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,4 @@ UpdateCenter.PluginCategory.cloud=Provedores de nuvem
LoadStatistics.Legends.AvailableExecutors=Executores disponíveis
Slave.UnixSlave=Este é um agente Unix
Build.post_build_steps_failed=Passos pós-construção falharam
ParametersDefinitionProperty.BuildButtonText=Construir
3 changes: 2 additions & 1 deletion core/src/main/resources/hudson/model/Messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ ParameterAction.DisplayName=Параметры
ParametersDefinitionProperty.DisplayName=Это - параметризованная сборка
ChoiceParameterDefinition.MissingChoices=Варианты обязательны.

UpdateCenter.CoreUpdateMonitor.DisplayName=Оповещение об обновлении Jenkins
UpdateCenter.CoreUpdateMonitor.DisplayName=Оповещение об обновлении Jenkins
ParametersDefinitionProperty.BuildButtonText=Собрать
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ParametersDefinitionProperty.DisplayName=Toto zostavenie je parametrizované
ParametersDefinitionProperty.BuildButtonText=Zostav
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,4 @@ CLI.disconnect-node.shortDescription=Прекини везу са машином
CLI.connect-node.shortDescription=Повежи са машином
CLI.offline-node.shortDescription=
Hudson.NotADirectory={0} није директоријум
ParametersDefinitionProperty.BuildButtonText=Изградња
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ManageJenkinsAction.DisplayName=Hantera Jenkins
ParametersDefinitionProperty.DisplayName=Detta bygge är parametriserat

FreeStyleProject.Description=Detta är en central del i Jenkins. Jenkins kommer att bygga ditt projekt med valfri versionshanterare och med vilket byggsystem som helst, och detta kan även användas för något annat än mjukvarubyggen.
ParametersDefinitionProperty.BuildButtonText=Bygg
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ ManagementLink.Category.TROUBLESHOOTING=Sorun Giderme
ManagementLink.Category.TOOLS=Araçlar ve Aksiyonlar
ManagementLink.Category.MISC=Diğer
ManagementLink.Category.UNCATEGORIZED=Sınıflandırılmamış
ParametersDefinitionProperty.BuildButtonText=Yapılandırma
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,4 @@ Jenkins.CheckDisplayName.DisplayNameNotUniqueWarning=已經有作業的顯示名

Jenkins.NotAllowedName="{0}" 並不是可以使用的名稱
ParametersDefinitionProperty.DisplayName=參數化建置
ParametersDefinitionProperty.BuildButtonText=建置
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ THE SOFTWARE.
<input type="hidden" name="redirectTo" value="." />
<button class="jenkins-button jenkins-button--primary jenkins-!-build-color">
<l:icon src="symbol-play" />
${%Build}
${it.buildButtonText}
</button>
<a href="./" class="jenkins-button">
${%Cancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@
# This build requires parameters:
description=\
Това изграждане изисква параметри:
Build=\
Изграждане
LOADING=\
ЗАРЕЖДАНЕ
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Build=Byg
description=Dette byg kræver parametre:
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
LOADING=LADE DATEN
description=Dieser Build erfordert Parameter:
Build=Build
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
# THE SOFTWARE.

description=Esta ejecución requiere parámetros adicionales:
Build=Ejecución
LOADING=CARGANDO
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is under the MIT License by authors

Build=Bild
LOADING=LAEN
description=See bild vajab parameetreid:
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
# THE SOFTWARE.

description=Ce build nécessite des paramètres :
Build=Build
LOADING=CHARGEMENT
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Build=Compilazione
description=Questa compilazione richiede dei parametri:
LOADING=Caricamento in corso
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
# THE SOFTWARE.

description=このビルドはパラメータが必要です。
Build=ビルド
LOADING=ロード中
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Build=빌드하기
LOADING=여는 중
description=매개변수가 필요한 빌드입니다.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file is under the MIT License by authors

Build=Bouwen
description=Deze bouwpoging heeft parameters nodig:
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Build=Buduj
LOADING=ŁADOWANIE
description=To zadanie wymaga parametrów:
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@

LOADING=CARREGANDO
description=Esta construção requer parâmetros:
Build=Construir
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is under the MIT License by authors

Build=Собрать
LOADING=ЗАГРУЗКА
description=Для этой сборки необходимы следующие параметры:
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Build=Zostav
description=Toto zostavenie vyžaduje parametre:
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

LOADING=УЧИТАВАЊЕ
description=Ова изградња захтева параметре:
Build=Изградња
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is under the MIT License by authors

Build=Bygg
LOADING=LADDAR
description=Det här bygget kräver parametrar:
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
# THE SOFTWARE.

description=tanım
Build=Yapılandırma
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@

LOADING=載入中
description=這項建置需要參數:
Build=建置

0 comments on commit 2fc718d

Please sign in to comment.