Skip to content

Commit b5a1feb

Browse files
committed
Make repeater item action labels translatable
1 parent 446a7ed commit b5a1feb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎settings/class-settings-api.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ public function set_translation_strings( $strings ) {
267267
'button_label' => 'Choose File',
268268
'previous_saved' => 'Previously saved',
269269
'repeater_new_item' => 'New Item',
270+
'repeater_move_up' => 'Move item up',
271+
'repeater_move_down' => 'Move item down',
272+
'repeater_remove_item' => 'Remove item',
270273
'required_label' => 'Required',
271274
'tom_select_no_results' => 'No results found for "%s"',
272275
'search_placeholder' => 'Search settings',

‎settings/class-settings-form.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,13 +1442,13 @@ public function render_repeater_item( $args, $index, $item = null ) {
14421442

14431443
<div class="repeater-item-footer">
14441444
<div class="repeater-item-actions">
1445-
<button type="button" class="button button-secondary move-up" aria-label="<?php esc_attr_e( 'Move item up', 'pfx' ); ?>" <?php disabled( $parent_disabled ); ?>>
1445+
<button type="button" class="button button-secondary move-up" aria-label="<?php echo esc_attr( $this->translation_strings['repeater_move_up'] ?? 'Move item up' ); ?>" <?php disabled( $parent_disabled ); ?>>
14461446
<span class="dashicons dashicons-arrow-up-alt2" aria-hidden="true"></span>
14471447
</button>
1448-
<button type="button" class="button button-secondary move-down" aria-label="<?php esc_attr_e( 'Move item down', 'pfx' ); ?>" <?php disabled( $parent_disabled ); ?>>
1448+
<button type="button" class="button button-secondary move-down" aria-label="<?php echo esc_attr( $this->translation_strings['repeater_move_down'] ?? 'Move item down' ); ?>" <?php disabled( $parent_disabled ); ?>>
14491449
<span class="dashicons dashicons-arrow-down-alt2" aria-hidden="true"></span>
14501450
</button>
1451-
<button type="button" class="button button-secondary remove-item" aria-label="<?php esc_attr_e( 'Remove item', 'pfx' ); ?>" <?php disabled( $parent_disabled ); ?>>
1451+
<button type="button" class="button button-secondary remove-item" aria-label="<?php echo esc_attr( $this->translation_strings['repeater_remove_item'] ?? 'Remove item' ); ?>" <?php disabled( $parent_disabled ); ?>>
14521452
<span class="dashicons dashicons-trash" aria-hidden="true"></span>
14531453
</button>
14541454
</div>

0 commit comments

Comments
 (0)