Skip to content

Commit 862f54f

Browse files
committed
Localize language strings
1 parent f1e4969 commit 862f54f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

SourceGithub/SourceGithub.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public function route_webhook( $p_request, $p_response, $p_args ) {
125125
if( $t_id ) {
126126
# Webhook already exists for this URL
127127
return $p_response
128-
->withStatus( HTTP_STATUS_CONFLICT, "Webhook already exists" )
128+
->withStatus( HTTP_STATUS_CONFLICT,
129+
plugin_lang_get( 'webhook_exists', 'SourceGithub' ) )
129130
->withJson( $t_hook );
130131
}
131132

@@ -149,7 +150,8 @@ public function route_webhook( $p_request, $p_response, $p_args ) {
149150
}
150151

151152
return $p_response
152-
->withStatus( HTTP_STATUS_CREATED, "Webhook id $t_id created" )
153+
->withStatus( HTTP_STATUS_CREATED,
154+
plugin_lang_get( 'webhook_success', 'SourceGithub' ) )
153155
->withHeader('Content-type', 'application/json')
154156
->write( $t_github_response->getBody() );
155157
}
@@ -304,7 +306,7 @@ public function update_repo_form( $p_repo ) {
304306
<div class="space-2"></div>
305307
<div id="webhook_create">
306308
<button type="button" class="btn btn-primary btn-white btn-round btn-sm">
307-
Create Webhook
309+
<?php echo plugin_lang_get( 'webhook_create' ); ?>
308310
</button>
309311

310312
<span id="webhook_status">

SourceGithub/lang/strings_english.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ $s_plugin_SourceGithub_hub_app_authorize = 'Click to Authorize';
2121
$s_plugin_SourceGithub_hub_app_authorized = 'Authorized';
2222
$s_plugin_SourceGithub_hub_app_revoke = 'Revoke';
2323

24+
$s_plugin_SourceGithub_webhook_create = 'Create Webhook';
25+
$s_plugin_SourceGithub_webhook_success= 'Webhook created successfully';
26+
$s_plugin_SourceGithub_webhook_exists = 'Webhook already exists';
27+
2428
$s_plugin_SourceGithub_repo_authorized = '<p>MantisBT is now authorized to access this GitHub repository.</p>';
2529
$s_plugin_SourceGithub_repo_authorization_failed = '<p style="color: red;">Sorry, MantisBT could not be authorized to access this GitHub repository.</p>';
2630

0 commit comments

Comments
 (0)