Skip to content

Commit

Permalink
Internationalization #136
Browse files Browse the repository at this point in the history
  • Loading branch information
abrain committed Mar 18, 2021
1 parent 8009a3a commit b9a66b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/Admin/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ public function enqueueEditScripts($hook)
wp_enqueue_script(
'einsatzverwaltung-edit-script',
Core::$scriptUrl . 'einsatzverwaltung-edit.js',
array('jquery', 'jquery-ui-autocomplete'),
array('jquery', 'jquery-ui-autocomplete', 'wp-i18n'),
Core::VERSION
);
wp_set_script_translations('einsatzverwaltung-edit-script', 'einsatzverwaltung');
wp_enqueue_style(
'einsatzverwaltung-edit',
Core::$styleUrl . 'style-edit.css',
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/ReportEditScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ public function displayMetaBoxEinsatzdetails(WP_Post $post)
__('Alarm time', 'einsatzverwaltung'),
'einsatzverwaltung_alarmzeit',
esc_attr($alarmzeit->format('Y-m-d H:i')),
'JJJJ-MM-TT hh:mm'
'YYYY-MM-TT hh:mm'
);

$this->echoInputText(
__('End time', 'einsatzverwaltung'),
'einsatz_einsatzende',
esc_attr($einsatzende),
'JJJJ-MM-TT hh:mm'
'YYYY-MM-TT hh:mm'
);

echo '</tbody></table><table><tbody>';
Expand Down
4 changes: 3 additions & 1 deletion src/js/einsatzverwaltung-edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { __ } = wp.i18n;

jQuery(document).ready(function() {
var datumsregex = /^(19|20)\d{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):([0-5][0-9])$/;
var hinweistext = 'Bitte das folgende Format einhalten: JJJJ-MM-TT hh:mm, z.B. <strong>2014-01-31 13:37</strong>';
const hinweistext = __('Please use the following format: YYYY-MM-TT hh:mm', 'einsatzverwaltung');

jQuery('#einsatzverwaltung_alarmzeit').after('&nbsp;<span class="einsatzverwaltung_hint" id="einsatzverwaltung_alarmzeit_hint"></span>');
jQuery('#einsatz_einsatzende').after('&nbsp;<span class="einsatzverwaltung_hint" id="einsatz_einsatzende_hint"></span>');
Expand Down

0 comments on commit b9a66b5

Please sign in to comment.