From e8f8fc7f5f5eba315290bc8d45348c3a4d4bee79 Mon Sep 17 00:00:00 2001 From: Bot Date: Wed, 29 Aug 2018 21:55:32 +0200 Subject: [PATCH] Replaced gettext translation `_()` with `__()` that uses the Translator class --- composer.json | 3 + includes/controller/angeltypes_controller.php | 26 +- .../controller/event_config_controller.php | 20 +- .../public_dashboard_controller.php | 2 +- .../controller/shift_entries_controller.php | 28 +- includes/controller/shifts_controller.php | 38 +-- includes/controller/shifttypes_controller.php | 14 +- .../controller/user_angeltypes_controller.php | 78 +++--- .../user_driver_licenses_controller.php | 12 +- .../controller/user_worklog_controller.php | 12 +- includes/controller/users_controller.php | 44 +-- includes/helper/email_helper.php | 6 +- includes/mailer/shifts_mailer.php | 28 +- includes/mailer/users_mailer.php | 4 +- includes/pages/admin_active.php | 66 ++--- includes/pages/admin_arrive.php | 66 ++--- includes/pages/admin_free.php | 20 +- includes/pages/admin_groups.php | 12 +- includes/pages/admin_import.php | 116 ++++---- includes/pages/admin_log.php | 6 +- includes/pages/admin_news.php | 22 +- includes/pages/admin_questions.php | 28 +- includes/pages/admin_rooms.php | 48 ++-- includes/pages/admin_shifts.php | 70 ++--- includes/pages/admin_user.php | 18 +- includes/pages/guest_credits.php | 2 +- includes/pages/guest_login.php | 108 ++++---- includes/pages/user_messages.php | 34 +-- includes/pages/user_myshifts.php | 14 +- includes/pages/user_news.php | 30 +-- includes/pages/user_questions.php | 10 +- includes/pages/user_settings.php | 26 +- includes/pages/user_shifts.php | 50 ++-- includes/sys_menu.php | 6 +- includes/sys_template.php | 2 +- includes/view/AngelTypes_view.php | 168 ++++++------ includes/view/EventConfig_view.php | 54 ++-- includes/view/PublicDashboard_view.php | 14 +- includes/view/Questions_view.php | 22 +- includes/view/Rooms_view.php | 6 +- includes/view/ShiftCalendarRenderer.php | 14 +- includes/view/ShiftCalendarShiftRenderer.php | 10 +- includes/view/ShiftEntry_view.php | 56 ++-- includes/view/ShiftTypes_view.php | 38 +-- includes/view/Shifts_view.php | 34 +-- includes/view/UserAngelTypes_view.php | 60 ++--- includes/view/UserDriverLicenses_view.php | 24 +- includes/view/UserWorkLog_view.php | 26 +- includes/view/User_view.php | 252 +++++++++--------- src/Middleware/LegacyMiddleware.php | 1 + 50 files changed, 926 insertions(+), 922 deletions(-) diff --git a/composer.json b/composer.json index 1f53e546..10e34804 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,10 @@ "php": ">=7.0.0", "ext-gettext": "*", "ext-json": "*", + "ext-libxml": "*", "ext-PDO": "*", + "ext-SimpleXML": "*", + "ext-xml": "*", "erusev/parsedown": "^1.6", "illuminate/container": "5.5.*", "illuminate/database": "5.5.*", diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index 210b6209..027e63ed 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -10,7 +10,7 @@ use Engelsystem\ShiftsFilterRenderer; */ function angeltypes_title() { - return _('Angeltypes'); + return __('Angeltypes'); } /** @@ -66,7 +66,7 @@ function angeltypes_about_controller() } return [ - _('Teams/Job description'), + __('Teams/Job description'), AngelTypes_about_view($angeltypes, isset($user)) ]; } @@ -88,12 +88,12 @@ function angeltype_delete_controller() if (request()->has('confirmed')) { AngelType_delete($angeltype); - success(sprintf(_('Angeltype %s deleted.'), AngelType_name_render($angeltype))); + success(sprintf(__('Angeltype %s deleted.'), AngelType_name_render($angeltype))); redirect(page_link_to('angeltypes')); } return [ - sprintf(_('Delete angeltype %s'), $angeltype['name']), + sprintf(__('Delete angeltype %s'), $angeltype['name']), AngelType_delete_view($angeltype) ]; } @@ -136,7 +136,7 @@ function angeltype_edit_controller() $angeltype['name'] = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('Please check the name. Maybe it already exists.')); + error(__('Please check the name. Maybe it already exists.')); } } @@ -166,7 +166,7 @@ function angeltype_edit_controller() } return [ - sprintf(_('Edit %s'), $angeltype['name']), + sprintf(__('Edit %s'), $angeltype['name']), AngelType_edit_view($angeltype, $supporter_mode) ]; } @@ -204,7 +204,7 @@ function angeltype_controller() } return [ - sprintf(_('Team %s'), $angeltype['name']), + sprintf(__('Team %s'), $angeltype['name']), AngelType_view( $angeltype, $members, @@ -289,7 +289,7 @@ function angeltypes_list_controller() $actions = [ button( page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), - _('view'), + __('view'), 'btn-xs' ) ]; @@ -297,12 +297,12 @@ function angeltypes_list_controller() if (in_array('admin_angel_types', $privileges)) { $actions[] = button( page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype['id']]), - _('edit'), + __('edit'), 'btn-xs' ); $actions[] = button( page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id']]), - _('delete'), + __('delete'), 'btn-xs' ); } @@ -313,13 +313,13 @@ function angeltypes_list_controller() page_link_to('user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $angeltype['user_angeltype_id']] ), - _('leave'), + __('leave'), 'btn-xs' ); } else { $actions[] = button( page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]), - _('join'), + __('join'), 'btn-xs' ); } @@ -356,7 +356,7 @@ function load_angeltype() $angeltype = AngelType($request->input('angeltype_id')); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist . ')); + error(__('Angeltype doesn\'t exist . ')); redirect(page_link_to('angeltypes')); } diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php index e64f47fd..c227b785 100644 --- a/includes/controller/event_config_controller.php +++ b/includes/controller/event_config_controller.php @@ -5,7 +5,7 @@ */ function event_config_title() { - return _('Event config'); + return __('Event config'); } /** @@ -54,40 +54,40 @@ function event_config_edit_controller() $event_welcome_msg = null; } - $result = check_request_date('buildup_start_date', _('Please enter buildup start date.'), true); + $result = check_request_date('buildup_start_date', __('Please enter buildup start date.'), true); $buildup_start_date = $result->getValue(); $valid &= $result->isValid(); - $result = check_request_date('event_start_date', _('Please enter event start date.'), true); + $result = check_request_date('event_start_date', __('Please enter event start date.'), true); $event_start_date = $result->getValue(); $valid &= $result->isValid(); - $result = check_request_date('event_end_date', _('Please enter event end date.'), true); + $result = check_request_date('event_end_date', __('Please enter event end date.'), true); $event_end_date = $result->getValue(); $valid &= $result->isValid(); - $result = check_request_date('teardown_end_date', _('Please enter teardown end date.'), true); + $result = check_request_date('teardown_end_date', __('Please enter teardown end date.'), true); $teardown_end_date = $result->getValue(); $valid &= $result->isValid(); if (!is_null($buildup_start_date) && !is_null($event_start_date) && $buildup_start_date > $event_start_date) { $valid = false; - error(_('The buildup start date has to be before the event start date.')); + error(__('The buildup start date has to be before the event start date.')); } if (!is_null($event_start_date) && !is_null($event_end_date) && $event_start_date > $event_end_date) { $valid = false; - error(_('The event start date has to be before the event end date.')); + error(__('The event start date has to be before the event end date.')); } if (!is_null($event_end_date) && !is_null($teardown_end_date) && $event_end_date > $teardown_end_date) { $valid = false; - error(_('The event end date has to be before the teardown end date.')); + error(__('The event end date has to be before the teardown end date.')); } if (!is_null($buildup_start_date) && !is_null($teardown_end_date) && $buildup_start_date > $teardown_end_date) { $valid = false; - error(_('The buildup start date has to be before the teardown end date.')); + error(__('The buildup start date has to be before the teardown end date.')); } if ($valid) { @@ -111,7 +111,7 @@ function event_config_edit_controller() date('Y-m-d', $teardown_end_date) ) ); - success(_('Settings saved.')); + success(__('Settings saved.')); redirect(page_link_to('admin_event_config')); } } diff --git a/includes/controller/public_dashboard_controller.php b/includes/controller/public_dashboard_controller.php index 23d5a4d6..37acbd63 100644 --- a/includes/controller/public_dashboard_controller.php +++ b/includes/controller/public_dashboard_controller.php @@ -24,7 +24,7 @@ function public_dashboard_controller() } return [ - _('Public Dashboard'), + __('Public Dashboard'), public_dashboard_view($stats, $free_shifts) ]; } diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index dbed09af..05a3a5e5 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -106,7 +106,7 @@ function shift_entry_create_controller_admin($shift, $angeltype) 'freeload_comment' => '' ]); - success(sprintf(_('%s has been subscribed to the shift.'), User_Nick_render($signup_user))); + success(sprintf(__('%s has been subscribed to the shift.'), User_Nick_render($signup_user))); redirect(shift_link($shift)); } @@ -146,7 +146,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype) $signup_user = User($request->input('user_id')); } if (!UserAngelType_exists($signup_user, $angeltype)) { - error(_('User is not in angeltype.')); + error(__('User is not in angeltype.')); redirect(shift_link($shift)); } @@ -163,7 +163,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype) ); if (!$shift_signup_state->isSignupAllowed()) { if ($shift_signup_state->getState() == ShiftSignupState::OCCUPIED) { - error(_('This shift is already occupied.')); + error(__('This shift is already occupied.')); } redirect(shift_link($shift)); } @@ -178,7 +178,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype) 'freeload_comment' => '' ]); - success(sprintf(_('%s has been subscribed to the shift.'), User_Nick_render($signup_user))); + success(sprintf(__('%s has been subscribed to the shift.'), User_Nick_render($signup_user))); redirect(shift_link($shift)); } @@ -203,17 +203,17 @@ function shift_entry_create_controller_supporter($shift, $angeltype) function shift_entry_error_message(ShiftSignupState $shift_signup_state) { if ($shift_signup_state->getState() == ShiftSignupState::ANGELTYPE) { - error(_('You need be accepted member of the angeltype.')); + error(__('You need be accepted member of the angeltype.')); } elseif ($shift_signup_state->getState() == ShiftSignupState::COLLIDES) { - error(_('This shift collides with one of your shifts.')); + error(__('This shift collides with one of your shifts.')); } elseif ($shift_signup_state->getState() == ShiftSignupState::OCCUPIED) { - error(_('This shift is already occupied.')); + error(__('This shift is already occupied.')); } elseif ($shift_signup_state->getState() == ShiftSignupState::SHIFT_ENDED) { - error(_('This shift ended already.')); + error(__('This shift ended already.')); } elseif ($shift_signup_state->getState() == ShiftSignupState::NOT_ARRIVED) { - error(_('You are not marked as arrived.')); + error(__('You are not marked as arrived.')); } elseif ($shift_signup_state->getState() == ShiftSignupState::SIGNED_UP) { - error(_('You are signed up for this shift.')); + error(__('You are signed up for this shift.')); } } @@ -263,7 +263,7 @@ function shift_entry_create_controller_user($shift, $angeltype) UserAngelType_create($signup_user, $angeltype); } - success(_('You are subscribed. Thank you!')); + success(__('You are subscribed. Thank you!')); redirect(shift_link($shift)); } @@ -322,7 +322,7 @@ function shift_entry_load() } $shiftEntry = ShiftEntry($request->input('shift_entry_id')); if (empty($shiftEntry)) { - error(_('Shift entry not found.')); + error(__('Shift entry not found.')); redirect(page_link_to('user_shifts')); } @@ -344,13 +344,13 @@ function shift_entry_delete_controller() $angeltype = AngelType($shiftEntry['TID']); $signout_user = User($shiftEntry['UID']); if (!Shift_signout_allowed($shift, $angeltype, $signout_user)) { - error(_('You are not allowed to remove this shift entry. If necessary, ask your supporter or heaven to do so.')); + error(__('You are not allowed to remove this shift entry. If necessary, ask your supporter or heaven to do so.')); redirect(user_link($signout_user)); } if ($request->has('continue')) { ShiftEntry_delete($shiftEntry); - success(_('Shift entry removed.')); + success(__('Shift entry removed.')); redirect(shift_link($shift)); } diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 326449cf..d2a37f3c 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -94,33 +94,33 @@ function shift_edit_controller() $rid = $request->input('rid'); } else { $valid = false; - $msg .= error(_('Please select a room.'), true); + $msg .= error(__('Please select a room.'), true); } if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) { $shifttype_id = $request->input('shifttype_id'); } else { $valid = false; - $msg .= error(_('Please select a shifttype.'), true); + $msg .= error(__('Please select a shifttype.'), true); } if ($request->has('start') && $tmp = parse_date('Y-m-d H:i', $request->input('start'))) { $start = $tmp; } else { $valid = false; - $msg .= error(_('Please enter a valid starting time for the shifts.'), true); + $msg .= error(__('Please enter a valid starting time for the shifts.'), true); } if ($request->has('end') && $tmp = parse_date('Y-m-d H:i', $request->input('end'))) { $end = $tmp; } else { $valid = false; - $msg .= error(_('Please enter a valid ending time for the shifts.'), true); + $msg .= error(__('Please enter a valid ending time for the shifts.'), true); } if ($start >= $end) { $valid = false; - $msg .= error(_('The ending time has to be after the starting time.'), true); + $msg .= error(__('The ending time has to be after the starting time.'), true); } foreach ($needed_angel_types as $needed_angeltype_id => $count) { @@ -133,7 +133,7 @@ function shift_edit_controller() } else { $valid = false; $msg .= error(sprintf( - _('Please check your input for needed angels of type %s.'), + __('Please check your input for needed angels of type %s.'), $angeltypes[$needed_angeltype_id] ), true); } @@ -163,7 +163,7 @@ function shift_edit_controller() . ' to ' . date('Y-m-d H:i', $end) . ' with angel types ' . join(', ', $needed_angel_types_info) ); - success(_('Shift updated.')); + success(__('Shift updated.')); redirect(shift_link([ 'SID' => $shift_id @@ -182,17 +182,17 @@ function shift_edit_controller() [ msg(), '', form([ - form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id), - form_text('title', _('Title'), $title), - form_select('rid', _('Room:'), $room, $rid), - form_text('start', _('Start:'), date('Y-m-d H:i', $start)), - form_text('end', _('End:'), date('Y-m-d H:i', $end)), - '

' . _('Needed angels') . '

', + form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id), + form_text('title', __('Title'), $title), + form_select('rid', __('Room:'), $room, $rid), + form_text('start', __('Start:'), date('Y-m-d H:i', $start)), + form_text('end', __('End:'), date('Y-m-d H:i', $end)), + '

' . __('Needed angels') . '

', $angel_types_spinner, - form_submit('submit', _('Save')) + form_submit('submit', __('Save')) ]) ] ); @@ -230,20 +230,20 @@ function shift_delete_controller() . ' from ' . date('Y-m-d H:i', $shift['start']) . ' to ' . date('Y-m-d H:i', $shift['end']) ); - success(_('Shift deleted.')); + success(__('Shift deleted.')); redirect(page_link_to('user_shifts')); } return page_with_title(shifts_title(), [ error(sprintf( - _('Do you want to delete the shift %s from %s to %s?'), + __('Do you want to delete the shift %s from %s to %s?'), $shift['name'], date('Y-m-d H:i', $shift['start']), date('H:i', $shift['end']) ), true), '' . _('delete') . '' + '">' . __('delete') . '' ]); } @@ -265,7 +265,7 @@ function shift_controller() $shift = Shift($request->input('shift_id')); if (empty($shift)) { - error(_('Shift could not be found.')); + error(__('Shift could not be found.')); redirect(page_link_to('user_shifts')); } diff --git a/includes/controller/shifttypes_controller.php b/includes/controller/shifttypes_controller.php index bc9c5c52..8b30ea60 100644 --- a/includes/controller/shifttypes_controller.php +++ b/includes/controller/shifttypes_controller.php @@ -30,12 +30,12 @@ function shifttype_delete_controller() ShiftType_delete($shifttype['id']); engelsystem_log('Deleted shifttype ' . $shifttype['name']); - success(sprintf(_('Shifttype %s deleted.'), $shifttype['name'])); + success(sprintf(__('Shifttype %s deleted.'), $shifttype['name'])); redirect(page_link_to('shifttypes')); } return [ - sprintf(_('Delete shifttype %s'), $shifttype['name']), + sprintf(__('Delete shifttype %s'), $shifttype['name']), ShiftType_delete_view($shifttype) ]; } @@ -58,7 +58,7 @@ function shifttype_edit_controller() if ($request->has('shifttype_id')) { $shifttype = ShiftType($request->input('shifttype_id')); if (empty($shifttype)) { - error(_('Shifttype not found.')); + error(__('Shifttype not found.')); redirect(page_link_to('shifttypes')); } $shifttype_id = $shifttype['id']; @@ -74,7 +74,7 @@ function shifttype_edit_controller() $name = strip_request_item('name'); } else { $valid = false; - error(_('Please enter a name.')); + error(__('Please enter a name.')); } if ($request->has('angeltype_id') && preg_match('/^\d+$/', $request->input('angeltype_id'))) { @@ -92,12 +92,12 @@ function shifttype_edit_controller() ShiftType_update($shifttype_id, $name, $angeltype_id, $description); engelsystem_log('Updated shifttype ' . $name); - success(_('Updated shifttype.')); + success(__('Updated shifttype.')); } else { $shifttype_id = ShiftType_create($name, $angeltype_id, $description); engelsystem_log('Created shifttype ' . $name); - success(_('Created shifttype.')); + success(__('Created shifttype.')); } redirect(page_link_to('shifttypes', ['action' => 'view', 'shifttype_id' => $shifttype_id])); } @@ -156,7 +156,7 @@ function shifttypes_list_controller() */ function shifttypes_title() { - return _('Shifttypes'); + return __('Shifttypes'); } /** diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index 5dae0595..aa614cf3 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -25,7 +25,7 @@ function user_angeltypes_unconfirmed_hint() return sprintf(ngettext('There is %d unconfirmed angeltype.', 'There are %d unconfirmed angeltypes.', count($unconfirmed_user_angeltypes)), - count($unconfirmed_user_angeltypes)) . ' ' . _('Angel types which need approvals:') . ' ' . join(', ', + count($unconfirmed_user_angeltypes)) . ' ' . __('Angel types which need approvals:') . ' ' . join(', ', $unconfirmed_links); } @@ -40,18 +40,18 @@ function user_angeltypes_delete_all_controller() $request = request(); if (!$request->has('angeltype_id')) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $angeltype = AngelType($request->input('angeltype_id')); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } if (!User_is_AngelType_supporter($user, $angeltype)) { - error(_('You are not allowed to delete all users for this angeltype.')); + error(__('You are not allowed to delete all users for this angeltype.')); redirect(page_link_to('angeltypes')); } @@ -59,12 +59,12 @@ function user_angeltypes_delete_all_controller() UserAngelTypes_delete_all($angeltype['id']); engelsystem_log(sprintf('Denied all users for angeltype %s', AngelType_name_render($angeltype))); - success(sprintf(_('Denied all users for angeltype %s.'), AngelType_name_render($angeltype))); + success(sprintf(__('Denied all users for angeltype %s.'), AngelType_name_render($angeltype))); redirect(page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']])); } return [ - _('Deny all users'), + __('Deny all users'), UserAngelTypes_delete_all_view($angeltype) ]; } @@ -80,18 +80,18 @@ function user_angeltypes_confirm_all_controller() $request = request(); if (!$request->has('angeltype_id')) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $angeltype = AngelType($request->input('angeltype_id')); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } if (!in_array('admin_user_angeltypes', $privileges) && !User_is_AngelType_supporter($user, $angeltype)) { - error(_('You are not allowed to confirm all users for this angeltype.')); + error(__('You are not allowed to confirm all users for this angeltype.')); redirect(page_link_to('angeltypes')); } @@ -99,12 +99,12 @@ function user_angeltypes_confirm_all_controller() UserAngelTypes_confirm_all($angeltype['id'], $user); engelsystem_log(sprintf('Confirmed all users for angeltype %s', AngelType_name_render($angeltype))); - success(sprintf(_('Confirmed all users for angeltype %s.'), AngelType_name_render($angeltype))); + success(sprintf(__('Confirmed all users for angeltype %s.'), AngelType_name_render($angeltype))); redirect(page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']])); } return [ - _('Confirm all users'), + __('Confirm all users'), UserAngelTypes_confirm_all_view($angeltype) ]; } @@ -120,30 +120,30 @@ function user_angeltype_confirm_controller() $request = request(); if (!$request->has('user_angeltype_id')) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $user_angeltype = UserAngelType($request->input('user_angeltype_id')); if (empty($user_angeltype)) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $angeltype = AngelType($user_angeltype['angeltype_id']); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } if (!User_is_AngelType_supporter($user, $angeltype)) { - error(_('You are not allowed to confirm this users angeltype.')); + error(__('You are not allowed to confirm this users angeltype.')); redirect(page_link_to('angeltypes')); } $user_source = User($user_angeltype['user_id']); if (empty($user_source)) { - error(_('User doesn\'t exist.')); + error(__('User doesn\'t exist.')); redirect(page_link_to('angeltypes')); } @@ -156,7 +156,7 @@ function user_angeltype_confirm_controller() AngelType_name_render($angeltype) )); success(sprintf( - _('%s confirmed for angeltype %s.'), + __('%s confirmed for angeltype %s.'), User_Nick_render($user_source), AngelType_name_render($angeltype) )); @@ -164,7 +164,7 @@ function user_angeltype_confirm_controller() } return [ - _('Confirm angeltype for user'), + __('Confirm angeltype for user'), UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype) ]; } @@ -180,37 +180,37 @@ function user_angeltype_delete_controller() $request = request(); if (!$request->has('user_angeltype_id')) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $user_angeltype = UserAngelType($request->input('user_angeltype_id')); if (empty($user_angeltype)) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $angeltype = AngelType($user_angeltype['angeltype_id']); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $user_source = User($user_angeltype['user_id']); if (empty($user_source)) { - error(_('User doesn\'t exist.')); + error(__('User doesn\'t exist.')); redirect(page_link_to('angeltypes')); } if ($user['UID'] != $user_angeltype['user_id'] && !User_is_AngelType_supporter($user, $angeltype)) { - error(_('You are not allowed to delete this users angeltype.')); + error(__('You are not allowed to delete this users angeltype.')); redirect(page_link_to('angeltypes')); } if ($request->has('confirmed')) { UserAngelType_delete($user_angeltype); - $success_message = sprintf(_('User %s removed from %s.'), User_Nick_render($user_source), $angeltype['name']); + $success_message = sprintf(__('User %s removed from %s.'), User_Nick_render($user_source), $angeltype['name']); engelsystem_log($success_message); success($success_message); @@ -218,7 +218,7 @@ function user_angeltype_delete_controller() } return [ - _('Remove angeltype'), + __('Remove angeltype'), UserAngelType_delete_view($user_angeltype, $user_source, $angeltype) ]; } @@ -235,37 +235,37 @@ function user_angeltype_update_controller() $request = request(); if (!in_array('admin_angel_types', $privileges)) { - error(_('You are not allowed to set supporter rights.')); + error(__('You are not allowed to set supporter rights.')); redirect(page_link_to('angeltypes')); } if (!$request->has('user_angeltype_id')) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } if ($request->has('supporter') && preg_match('/^[01]$/', $request->input('supporter'))) { $supporter = $request->input('supporter') == '1'; } else { - error(_('No supporter update given.')); + error(__('No supporter update given.')); redirect(page_link_to('angeltypes')); } $user_angeltype = UserAngelType($request->input('user_angeltype_id')); if (empty($user_angeltype)) { - error(_('User angeltype doesn\'t exist.')); + error(__('User angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $angeltype = AngelType($user_angeltype['angeltype_id']); if (empty($angeltype)) { - error(_('Angeltype doesn\'t exist.')); + error(__('Angeltype doesn\'t exist.')); redirect(page_link_to('angeltypes')); } $user_source = User($user_angeltype['user_id']); if (empty($user_source)) { - error(_('User doesn\'t exist.')); + error(__('User doesn\'t exist.')); redirect(page_link_to('angeltypes')); } @@ -274,8 +274,8 @@ function user_angeltype_update_controller() $success_message = sprintf( $supporter - ? _('Added supporter rights for %s to %s.') - : _('Removed supporter rights for %s from %s.'), + ? __('Added supporter rights for %s to %s.') + : __('Removed supporter rights for %s from %s.'), AngelType_name_render($angeltype), User_Nick_render($user_source) ); @@ -286,7 +286,7 @@ function user_angeltype_update_controller() } return [ - $supporter ? _('Add supporter rights') : _('Remove supporter rights'), + $supporter ? __('Add supporter rights') : __('Remove supporter rights'), UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter) ]; } @@ -326,7 +326,7 @@ function user_angeltype_add_controller() AngelType_name_render($angeltype) )); success(sprintf( - _('User %s added to %s.'), + __('User %s added to %s.'), User_Nick_render($user_source), AngelType_name_render($angeltype) )); @@ -343,7 +343,7 @@ function user_angeltype_add_controller() } return [ - _('Add user to angeltype'), + __('Add user to angeltype'), UserAngelType_add_view($angeltype, $users_source, $user_source['UID']) ]; } @@ -360,14 +360,14 @@ function user_angeltype_join_controller($angeltype) $user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype); if (!empty($user_angeltype)) { - error(sprintf(_('You are already a %s.'), $angeltype['name'])); + error(sprintf(__('You are already a %s.'), $angeltype['name'])); redirect(page_link_to('angeltypes')); } if (request()->has('confirmed')) { $user_angeltype_id = UserAngelType_create($user, $angeltype); - $success_message = sprintf(_('You joined %s.'), $angeltype['name']); + $success_message = sprintf(__('You joined %s.'), $angeltype['name']); engelsystem_log(sprintf( 'User %s joined %s.', User_Nick_render($user), @@ -388,7 +388,7 @@ function user_angeltype_join_controller($angeltype) } return [ - sprintf(_('Become a %s'), $angeltype['name']), + sprintf(__('Become a %s'), $angeltype['name']), UserAngelType_join_view($user, $angeltype) ]; } diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index 889b03e3..6621866d 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -21,8 +21,8 @@ function user_driver_license_required_hint() foreach ($angeltypes as $angeltype) { if ($angeltype['requires_driver_license']) { return sprintf( - _('You joined an angeltype which requires a driving license. Please edit your driving license information here: %s.'), - '' . _('driving license information') . '' + __('You joined an angeltype which requires a driving license. Please edit your driving license information here: %s.'), + '' . __('driving license information') . '' ); } } @@ -128,21 +128,21 @@ function user_driver_license_edit_controller() UserDriverLicenses_update($user_driver_license); } engelsystem_log('Driver license information updated.'); - success(_('Your driver license information has been saved.')); + success(__('Your driver license information has been saved.')); redirect(user_link($user_source)); } else { - error(_('Please select at least one driving license.')); + error(__('Please select at least one driving license.')); } } elseif (!empty($user_driver_license['user_id'])) { UserDriverLicenses_delete($user_source['UID']); engelsystem_log('Driver license information removed.'); - success(_('Your driver license information has been removed.')); + success(__('Your driver license information has been removed.')); redirect(user_link($user_source)); } } return [ - sprintf(_('Edit %s driving license information'), $user_source['Nick']), + sprintf(__('Edit %s driving license information'), $user_source['Nick']), UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver_license) ]; } diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index a7218071..640dcaba 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -19,7 +19,7 @@ function user_worklog_delete_controller() if ($request->has('confirmed')) { UserWorkLog_delete($userWorkLog); - success(_('Work log entry deleted.')); + success(__('Work log entry deleted.')); redirect(user_link($user_source)); } @@ -51,7 +51,7 @@ function user_worklog_edit_controller() if ($valid) { UserWorkLog_update($userWorkLog); - success(_('Work log entry updated.')); + success(__('Work log entry updated.')); redirect(user_link($user_source)); } } @@ -80,19 +80,19 @@ function user_worklog_from_request($userWorkLog) ); if (is_null($userWorkLog['work_timestamp'])) { $valid = false; - error(_('Please enter work date.')); + error(__('Please enter work date.')); } $userWorkLog['work_hours'] = $request->input('work_hours'); if (!preg_match("/[0-9]+(\.[0-9]+)?/", $userWorkLog['work_hours'])) { $valid = false; - error(_('Please enter work hours in format ##[.##].')); + error(__('Please enter work hours in format ##[.##].')); } $userWorkLog['comment'] = $request->input('comment'); if (empty($userWorkLog['comment'])) { $valid = false; - error(_('Please enter a comment.')); + error(__('Please enter a comment.')); } return [ @@ -124,7 +124,7 @@ function user_worklog_add_controller() if ($valid) { UserWorkLog_create($userWorkLog); - success(_('Work log entry created.')); + success(__('Work log entry created.')); redirect(user_link($user_source)); } } diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index b6334803..d7f97c7e 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -58,7 +58,7 @@ function user_delete_controller() // You cannot delete yourself if ($user['UID'] == $user_source['UID']) { - error(_('You cannot delete yourself.')); + error(__('You cannot delete yourself.')); redirect(user_link($user)); } @@ -72,14 +72,14 @@ function user_delete_controller() ) ) { $valid = false; - error(_('Your password is incorrect. Please try it again.')); + error(__('Your password is incorrect. Please try it again.')); } if ($valid) { User_delete($user_source['UID']); mail_user_delete($user_source); - success(_('User deleted.')); + success(__('User deleted.')); engelsystem_log(sprintf('Deleted %s', User_Nick_render($user_source))); redirect(users_link()); @@ -87,7 +87,7 @@ function user_delete_controller() } return [ - sprintf(_('Delete %s'), $user_source['Nick']), + sprintf(__('Delete %s'), $user_source['Nick']), User_delete_view($user_source) ]; } @@ -157,7 +157,7 @@ function user_edit_vouchers_controller() $vouchers = trim($request->input('vouchers')); } else { $valid = false; - error(_('Please enter a valid number of vouchers.')); + error(__('Please enter a valid number of vouchers.')); } if ($valid) { @@ -165,7 +165,7 @@ function user_edit_vouchers_controller() User_update($user_source); - success(_('Saved the number of vouchers.')); + success(__('Saved the number of vouchers.')); engelsystem_log(User_Nick_render($user_source) . ': ' . sprintf('Got %s vouchers', $user_source['got_voucher'])); @@ -174,7 +174,7 @@ function user_edit_vouchers_controller() } return [ - sprintf(_('%s\'s vouchers'), $user_source['Nick']), + sprintf(__('%s\'s vouchers'), $user_source['Nick']), User_edit_vouchers_view($user_source) ]; } @@ -191,7 +191,7 @@ function user_controller() if ($request->has('user_id')) { $user_source = User($request->input('user_id')); if (empty($user_source)) { - error(_('User not found.')); + error(__('User not found.')); redirect(page_link_to('/')); } } @@ -226,7 +226,7 @@ function user_controller() } if ($user_source['force_active']) { - $tshirt_score = _('Enough'); + $tshirt_score = __('Enough'); } else { $tshirt_score = sprintf('%.2f', User_tshirt_score($user_source)) . ' h'; } @@ -274,7 +274,7 @@ function users_list_controller() } return [ - _('All users'), + __('All users'), Users_view( $users, $order_by, @@ -298,7 +298,7 @@ function user_password_recovery_set_new_controller() $request = request(); $user_source = User_by_password_recovery_token($request->input('token')); if (empty($user_source)) { - error(_('Token is not correct.')); + error(__('Token is not correct.')); redirect(page_link_to('login')); } @@ -311,16 +311,16 @@ function user_password_recovery_set_new_controller() ) { if ($request->postData('password') != $request->postData('password2')) { $valid = false; - error(_('Your passwords don\'t match.')); + error(__('Your passwords don\'t match.')); } } else { $valid = false; - error(_('Your password is to short (please use at least 6 characters).')); + error(__('Your password is to short (please use at least 6 characters).')); } if ($valid) { set_password($user_source['UID'], $request->postData('password')); - success(_('Password saved.')); + success(__('Password saved.')); redirect(page_link_to('login')); } } @@ -345,28 +345,28 @@ function user_password_recovery_start_controller() $user_source = User_by_email($email); if (empty($user_source)) { $valid = false; - error(_('E-mail address is not correct.')); + error(__('E-mail address is not correct.')); } } else { $valid = false; - error(_('E-mail address is not correct.')); + error(__('E-mail address is not correct.')); } } else { $valid = false; - error(_('Please enter your e-mail.')); + error(__('Please enter your e-mail.')); } if ($valid) { $token = User_generate_password_recovery_token($user_source); engelsystem_email_to_user( $user_source, - _('Password recovery'), + __('Password recovery'), sprintf( - _('Please visit %s to recover your password.'), + __('Please visit %s to recover your password.'), page_link_to('user_password_recovery', ['token' => $token]) ) ); - success(_('We sent an email containing your password recovery link.')); + success(__('We sent an email containing your password recovery link.')); redirect(page_link_to('login')); } } @@ -396,7 +396,7 @@ function user_password_recovery_controller() */ function user_password_recovery_title() { - return _('Password recovery'); + return __('Password recovery'); } /** @@ -413,7 +413,7 @@ function load_user() $user = User($request->input('user_id')); if (empty($user)) { - error(_('User doesn\'t exist.')); + error(__('User doesn\'t exist.')); redirect(page_link_to()); } diff --git a/includes/helper/email_helper.php b/includes/helper/email_helper.php index 8d1cb794..a0631550 100644 --- a/includes/helper/email_helper.php +++ b/includes/helper/email_helper.php @@ -20,10 +20,10 @@ function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_it $locale = $translator->getLocale(); $translator->setLocale($recipient_user['Sprache']); - $message = sprintf(_('Hi %s,'), $recipient_user['Nick']) . "\n\n" - . _('here is a message for you from the engelsystem:') . "\n\n" + $message = sprintf(__('Hi %s,'), $recipient_user['Nick']) . "\n\n" + . __('here is a message for you from the engelsystem:') . "\n\n" . $message . "\n\n" - . _('This email is autogenerated and has not been signed. You got this email because you are registered in the engelsystem.'); + . __('This email is autogenerated and has not been signed. You got this email because you are registered in the engelsystem.'); $translator->setLocale($locale); return engelsystem_email($recipient_user['email'], $title, $message); diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php index a69aab3a..4dd430d3 100644 --- a/includes/mailer/shifts_mailer.php +++ b/includes/mailer/shifts_mailer.php @@ -12,22 +12,22 @@ function mail_shift_change($old_shift, $new_shift) $noticeable_changes = false; - $message = _('A Shift you are registered on has changed:'); + $message = __('A Shift you are registered on has changed:'); $message .= "\n"; if ($old_shift['name'] != $new_shift['name']) { - $message .= sprintf(_('* Shift type changed from %s to %s'), $old_shift['name'], $new_shift['name']) . "\n"; + $message .= sprintf(__('* Shift type changed from %s to %s'), $old_shift['name'], $new_shift['name']) . "\n"; $noticeable_changes = true; } if ($old_shift['title'] != $new_shift['title']) { - $message .= sprintf(_('* Shift title changed from %s to %s'), $old_shift['title'], $new_shift['title']) . "\n"; + $message .= sprintf(__('* Shift title changed from %s to %s'), $old_shift['title'], $new_shift['title']) . "\n"; $noticeable_changes = true; } if ($old_shift['start'] != $new_shift['start']) { $message .= sprintf( - _('* Shift Start changed from %s to %s'), + __('* Shift Start changed from %s to %s'), date('Y-m-d H:i', $old_shift['start']), date('Y-m-d H:i', $new_shift['start']) ) . "\n"; @@ -36,7 +36,7 @@ function mail_shift_change($old_shift, $new_shift) if ($old_shift['end'] != $new_shift['end']) { $message .= sprintf( - _('* Shift End changed from %s to %s'), + __('* Shift End changed from %s to %s'), date('Y-m-d H:i', $old_shift['end']), date('Y-m-d H:i', $new_shift['end']) ) . "\n"; @@ -44,7 +44,7 @@ function mail_shift_change($old_shift, $new_shift) } if ($old_shift['RID'] != $new_shift['RID']) { - $message .= sprintf(_('* Shift Location changed from %s to %s'), $old_room['Name'], $new_room['Name']) . "\n"; + $message .= sprintf(__('* Shift Location changed from %s to %s'), $old_room['Name'], $new_room['Name']) . "\n"; $noticeable_changes = true; } @@ -54,7 +54,7 @@ function mail_shift_change($old_shift, $new_shift) } $message .= "\n"; - $message .= _('The updated Shift:') . "\n"; + $message .= __('The updated Shift:') . "\n"; $message .= $new_shift['name'] . "\n"; $message .= $new_shift['title'] . "\n"; @@ -65,7 +65,7 @@ function mail_shift_change($old_shift, $new_shift) if ($user['email_shiftinfo']) { engelsystem_email_to_user( $user, - '[engelsystem] ' . _('Your Shift has changed'), + '[engelsystem] ' . __('Your Shift has changed'), $message, true ); @@ -81,7 +81,7 @@ function mail_shift_delete($shift) $users = ShiftEntries_by_shift($shift['SID']); $room = Room($shift['RID']); - $message = _('A Shift you are registered on was deleted:') . "\n"; + $message = __('A Shift you are registered on was deleted:') . "\n"; $message .= $shift['name'] . "\n"; $message .= $shift['title'] . "\n"; @@ -90,7 +90,7 @@ function mail_shift_delete($shift) foreach ($users as $user) { if ($user['email_shiftinfo']) { - engelsystem_email_to_user($user, '[engelsystem] ' . _('Your Shift was deleted'), $message, true); + engelsystem_email_to_user($user, '[engelsystem] ' . __('Your Shift was deleted'), $message, true); } } } @@ -107,13 +107,13 @@ function mail_shift_assign($user, $shift) $room = Room($shift['RID']); - $message = _('You have been assigned to a Shift:') . "\n"; + $message = __('You have been assigned to a Shift:') . "\n"; $message .= $shift['name'] . "\n"; $message .= $shift['title'] . "\n"; $message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n"; $message .= $room['Name'] . "\n"; - engelsystem_email_to_user($user, '[engelsystem] ' . _('Assigned to Shift'), $message, true); + engelsystem_email_to_user($user, '[engelsystem] ' . __('Assigned to Shift'), $message, true); } /** @@ -128,11 +128,11 @@ function mail_shift_removed($user, $shift) $room = Room($shift['RID']); - $message = _('You have been removed from a Shift:') . "\n"; + $message = __('You have been removed from a Shift:') . "\n"; $message .= $shift['name'] . "\n"; $message .= $shift['title'] . "\n"; $message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n"; $message .= $room['Name'] . "\n"; - engelsystem_email_to_user($user, '[engelsystem] ' . _('Removed from Shift'), $message, true); + engelsystem_email_to_user($user, '[engelsystem] ' . __('Removed from Shift'), $message, true); } diff --git a/includes/mailer/users_mailer.php b/includes/mailer/users_mailer.php index b3f335d7..5f1e6e79 100644 --- a/includes/mailer/users_mailer.php +++ b/includes/mailer/users_mailer.php @@ -8,7 +8,7 @@ function mail_user_delete($user) { return engelsystem_email_to_user( $user, - '[engelsystem] ' . _('Your account has been deleted'), - _('Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.') + '[engelsystem] ' . __('Your account has been deleted'), + __('Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.') ); } diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 35dbe60b..7aeb249f 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_active_title() { - return _('Active angels'); + return __('Active angels'); } /** @@ -39,14 +39,14 @@ function admin_active() $count = strip_request_item('count'); if ($count < $forced_count) { error(sprintf( - _('At least %s angels are forced to be active. The number has to be greater.'), + __('At least %s angels are forced to be active. The number has to be greater.'), $forced_count )); redirect(page_link_to('admin_active')); } } else { $valid = false; - $msg .= error(_('Please enter a number of angels to be marked as active.'), true); + $msg .= error(__('Please enter a number of angels to be marked as active.'), true); } if ($valid) { @@ -84,16 +84,16 @@ function admin_active() engelsystem_log('These angels are active now: ' . join(', ', $user_nicks)); $limit = ''; - $msg = success(_('Marked angels.'), true); + $msg = success(__('Marked angels.'), true); } else { $set_active = '« ' - . _('back') + . __('back') . ' | ' - . _('apply') + . __('apply') . ''; } } @@ -104,9 +104,9 @@ function admin_active() if (!empty($user_source)) { DB::update('UPDATE `User` SET `Aktiv`=1 WHERE `UID`=? LIMIT 1', [$user_id]); engelsystem_log('User ' . User_Nick_render($user_source) . ' is active now.'); - $msg = success(_('Angel has been marked as active.'), true); + $msg = success(__('Angel has been marked as active.'), true); } else { - $msg = error(_('Angel not found.'), true); + $msg = error(__('Angel not found.'), true); } } elseif ($request->has('not_active') && preg_match('/^\d+$/', $request->input('not_active'))) { $user_id = $request->input('not_active'); @@ -114,9 +114,9 @@ function admin_active() if (!empty($user_source)) { DB::update('UPDATE `User` SET `Aktiv`=0 WHERE `UID`=? LIMIT 1', [$user_id]); engelsystem_log('User ' . User_Nick_render($user_source) . ' is NOT active now.'); - $msg = success(_('Angel has been marked as not active.'), true); + $msg = success(__('Angel has been marked as not active.'), true); } else { - $msg = error(_('Angel not found.'), true); + $msg = error(__('Angel not found.'), true); } } elseif ($request->has('tshirt') && preg_match('/^\d+$/', $request->input('tshirt'))) { $user_id = $request->input('tshirt'); @@ -124,7 +124,7 @@ function admin_active() if (!empty($user_source)) { DB::update('UPDATE `User` SET `Tshirt`=1 WHERE `UID`=? LIMIT 1', [$user_id]); engelsystem_log('User ' . User_Nick_render($user_source) . ' has tshirt now.'); - $msg = success(_('Angel has got a t-shirt.'), true); + $msg = success(__('Angel has got a t-shirt.'), true); } else { $msg = error('Angel not found.', true); } @@ -134,9 +134,9 @@ function admin_active() if (!empty($user_source)) { DB::update('UPDATE `User` SET `Tshirt`=0 WHERE `UID`=? LIMIT 1', [$user_id]); engelsystem_log('User ' . User_Nick_render($user_source) . ' has NO tshirt.'); - $msg = success(_('Angel has got no t-shirt.'), true); + $msg = success(__('Angel has got no t-shirt.'), true); } else { - $msg = error(_('Angel not found.'), true); + $msg = error(__('Angel not found.'), true); } } @@ -197,7 +197,7 @@ function admin_active() $parameters['show_all_shifts'] = 1; } $actions[] = '' - . _('set active') + . __('set active') . ''; } if ($usr['Aktiv'] == 1) { @@ -209,7 +209,7 @@ function admin_active() $parametersRemove['show_all_shifts'] = 1; } $actions[] = '' - . _('remove active') + . __('remove active') . ''; } if ($usr['Tshirt'] == 0) { @@ -221,7 +221,7 @@ function admin_active() $parametersShirt['show_all_shifts'] = 1; } $actions[] = '' - . _('got t-shirt') + . __('got t-shirt') . ''; } if ($usr['Tshirt'] == 1) { @@ -233,7 +233,7 @@ function admin_active() $parameters['show_all_shifts'] = 1; } $actions[] = '' - . _('remove t-shirt') + . __('remove t-shirt') . ''; } @@ -259,35 +259,35 @@ function admin_active() $shirtCount = User_tshirts_count(); $shirt_statistics[] = [ - 'size' => '' . _('Sum') . '', + 'size' => '' . __('Sum') . '', 'given' => '' . $shirtCount . '' ]; return page_with_title(admin_active_title(), [ form([ - form_text('search', _('Search angel:'), $search), - form_checkbox('show_all_shifts', _('Show all shifts'), $show_all_shifts), - form_submit('submit', _('Search')) + form_text('search', __('Search angel:'), $search), + form_checkbox('show_all_shifts', __('Show all shifts'), $show_all_shifts), + form_submit('submit', __('Search')) ], page_link_to('admin_active')), $set_active == '' ? form([ - form_text('count', _('How much angels should be active?'), $count), - form_submit('set_active', _('Preview')) + form_text('count', __('How much angels should be active?'), $count), + form_submit('set_active', __('Preview')) ]) : $set_active, $msg . msg(), table([ - 'nick' => _('Nickname'), - 'shirt_size' => _('Size'), - 'shift_count' => _('Shifts'), - 'work_time' => _('Length'), - 'active' => _('Active?'), - 'force_active' => _('Forced'), - 'tshirt' => _('T-shirt?'), + 'nick' => __('Nickname'), + 'shirt_size' => __('Size'), + 'shift_count' => __('Shifts'), + 'work_time' => __('Length'), + 'active' => __('Active?'), + 'force_active' => __('Forced'), + 'tshirt' => __('T-shirt?'), 'actions' => '' ], $matched_users), - '

' . _('Shirt statistics') . '

', + '

' . __('Shirt statistics') . '

', table([ - 'size' => _('Size'), - 'given' => _('Given shirts') + 'size' => __('Size'), + 'given' => __('Given shirts') ], $shirt_statistics) ]); } diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php index 8dada3e2..c6b3eccd 100644 --- a/includes/pages/admin_arrive.php +++ b/includes/pages/admin_arrive.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_arrive_title() { - return _('Arrived angels'); + return __('Arrived angels'); } /** @@ -34,10 +34,10 @@ function admin_arrive() LIMIT 1 ', [$user_id]); engelsystem_log('User set to not arrived: ' . User_Nick_render($user_source)); - success(_('Reset done. Angel has not arrived.')); + success(__('Reset done. Angel has not arrived.')); redirect(user_link($user_source)); } else { - $msg = error(_('Angel not found.'), true); + $msg = error(__('Angel not found.'), true); } } elseif ($request->has('arrived') && preg_match('/^\d+$/', $request->input('arrived'))) { $user_id = $request->input('arrived'); @@ -50,10 +50,10 @@ function admin_arrive() LIMIT 1 ', [time(), $user_id]); engelsystem_log('User set has arrived: ' . User_Nick_render($user_source)); - success(_('Angel has been marked as arrived.')); + success(__('Angel has been marked as arrived.')); redirect(user_link($user_source)); } else { - $msg = error(_('Angel not found.'), true); + $msg = error(__('Angel not found.'), true); } } @@ -90,16 +90,16 @@ function admin_arrive() } $usr['rendered_planned_arrival_date'] = date('Y-m-d', $usr['planned_arrival_date']); $usr['rendered_arrival_date'] = $usr['arrival_date'] > 0 ? date('Y-m-d', $usr['arrival_date']) : '-'; - $usr['arrived'] = $usr['Gekommen'] == 1 ? _('yes') : ''; + $usr['arrived'] = $usr['Gekommen'] == 1 ? __('yes') : ''; $usr['actions'] = $usr['Gekommen'] == 1 ? '' . _('reset') . '' + ) . '">' . __('reset') . '' : '' . _('arrived') . ''; + ) . '">' . __('arrived') . ''; if ($usr['arrival_date'] > 0) { $day = date('Y-m-d', $usr['arrival_date']); @@ -168,61 +168,61 @@ function admin_arrive() return page_with_title(admin_arrive_title(), [ $msg . msg(), form([ - form_text('search', _('Search'), $search), - form_submit('submit', _('Search')) + form_text('search', __('Search'), $search), + form_submit('submit', __('Search')) ]), table([ - 'nick' => _('Nickname'), - 'rendered_planned_arrival_date' => _('Planned arrival'), - 'arrived' => _('Arrived?'), - 'rendered_arrival_date' => _('Arrival date'), - 'rendered_planned_departure_date' => _('Planned departure'), + 'nick' => __('Nickname'), + 'rendered_planned_arrival_date' => __('Planned arrival'), + 'arrived' => __('Arrived?'), + 'rendered_arrival_date' => __('Arrival date'), + 'rendered_planned_departure_date' => __('Planned departure'), 'actions' => '' ], $users_matched), div('row', [ div('col-md-4', [ - heading(_('Planned arrival statistics'), 2), + heading(__('Planned arrival statistics'), 2), bargraph('planned_arrives', 'day', [ - 'count' => _('arrived'), - 'sum' => _('arrived sum') + 'count' => __('arrived'), + 'sum' => __('arrived sum') ], [ 'count' => '#090', 'sum' => '#888' ], $planned_arrival_at_day), table([ - 'day' => _('Date'), - 'count' => _('Count'), - 'sum' => _('Sum') + 'day' => __('Date'), + 'count' => __('Count'), + 'sum' => __('Sum') ], $planned_arrival_at_day) ]), div('col-md-4', [ - heading(_('Arrival statistics'), 2), + heading(__('Arrival statistics'), 2), bargraph('arrives', 'day', [ - 'count' => _('arrived'), - 'sum' => _('arrived sum') + 'count' => __('arrived'), + 'sum' => __('arrived sum') ], [ 'count' => '#090', 'sum' => '#888' ], $arrival_at_day), table([ - 'day' => _('Date'), - 'count' => _('Count'), - 'sum' => _('Sum') + 'day' => __('Date'), + 'count' => __('Count'), + 'sum' => __('Sum') ], $arrival_at_day) ]), div('col-md-4', [ - heading(_('Planned departure statistics'), 2), + heading(__('Planned departure statistics'), 2), bargraph('planned_departures', 'day', [ - 'count' => _('arrived'), - 'sum' => _('arrived sum') + 'count' => __('arrived'), + 'sum' => __('arrived sum') ], [ 'count' => '#090', 'sum' => '#888' ], $planned_departure_at_day), table([ - 'day' => _('Date'), - 'count' => _('Count'), - 'sum' => _('Sum') + 'day' => __('Date'), + 'count' => __('Count'), + 'sum' => __('Sum') ], $planned_departure_at_day) ]) ]) diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index a3c0d17f..d1d102c7 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_free_title() { - return _('Free angels'); + return __('Free angels'); } /** @@ -94,7 +94,7 @@ function admin_free() 'email' => $usr['email_by_human_allowed'] ? $usr['email'] : glyph('eye-close'), 'actions' => in_array('admin_user', $privileges) - ? button(page_link_to('admin_user', ['id' => $usr['UID']]), _('edit'), 'btn-xs') + ? button(page_link_to('admin_user', ['id' => $usr['UID']]), __('edit'), 'btn-xs') : '' ]; } @@ -102,25 +102,25 @@ function admin_free() form([ div('row', [ div('col-md-4', [ - form_text('search', _('Search'), $search) + form_text('search', __('Search'), $search) ]), div('col-md-4', [ - form_select('angeltype', _('Angeltype'), $angel_types, $angelType) + form_select('angeltype', __('Angeltype'), $angel_types, $angelType) ]), div('col-md-2', [ - form_checkbox('confirmed_only', _('Only confirmed'), $request->has('confirmed_only')) + form_checkbox('confirmed_only', __('Only confirmed'), $request->has('confirmed_only')) ]), div('col-md-2', [ - form_submit('submit', _('Search')) + form_submit('submit', __('Search')) ]) ]) ]), table([ - 'name' => _('Nick'), + 'name' => __('Nick'), 'shift_state' => '', - 'dect' => _('DECT'), - 'jabber' => _('Jabber'), - 'email' => _('E-Mail'), + 'dect' => __('DECT'), + 'jabber' => __('Jabber'), + 'email' => __('E-Mail'), 'actions' => '' ], $free_users_table) ]); diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php index 92b6a3ea..727d7be5 100644 --- a/includes/pages/admin_groups.php +++ b/includes/pages/admin_groups.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_groups_title() { - return _('Grouprights'); + return __('Grouprights'); } /** @@ -40,7 +40,7 @@ function admin_groups() 'actions' => button( page_link_to('admin_groups', ['action' => 'edit', 'id' => $group['UID']]), - _('edit'), + __('edit'), 'btn-xs' ) ]; @@ -48,8 +48,8 @@ function admin_groups() return page_with_title(admin_groups_title(), [ table([ - 'name' => _('Name'), - 'privileges' => _('Privileges'), + 'name' => __('Name'), + 'privileges' => __('Privileges'), 'actions' => '' ], $groups_table) ]); @@ -97,8 +97,8 @@ function admin_groups() ); } - $privileges_form[] = form_submit('submit', _('Save')); - $html .= page_with_title(_('Edit group'), [ + $privileges_form[] = form_submit('submit', __('Save')); + $html .= page_with_title(__('Edit group'), [ form( $privileges_form, page_link_to('admin_groups', ['action' => 'save', 'id' => $group_id]) diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php index 3688259b..29aa719b 100644 --- a/includes/pages/admin_import.php +++ b/includes/pages/admin_import.php @@ -5,7 +5,7 @@ */ function admin_import_title() { - return _('Frab import'); + return __('Frab import'); } /** @@ -35,7 +35,7 @@ function admin_import() fclose($test_handle); @unlink($import_dir . '/tmp'); } catch (Exception $e) { - error(_('Webserver has no write-permission on import directory.')); + error(__('Webserver has no write-permission on import directory.')); } $import_file = $import_dir . '/import_' . $user['UID'] . '.xml'; @@ -60,7 +60,7 @@ function admin_import() $shifttype_id = $request->input('shifttype_id'); } else { $valid = false; - error(_('Please select a shift type.')); + error(__('Please select a shift type.')); } $minutes_start = trim($request->input('add_minutes_start')); @@ -68,14 +68,14 @@ function admin_import() $add_minutes_start = $minutes_start; } else { $valid = false; - error(_('Please enter an amount of minutes to add to a talk\'s begin.')); + error(__('Please enter an amount of minutes to add to a talk\'s begin.')); } if ($request->has('add_minutes_end') && is_numeric(trim($request->input('add_minutes_end')))) { $add_minutes_end = trim($request->input('add_minutes_end')); } else { $valid = false; - error(_('Please enter an amount of minutes to add to a talk\'s end.')); + error(__('Please enter an amount of minutes to add to a talk\'s end.')); } if (isset($_FILES['xcal_file']) && ($_FILES['xcal_file']['error'] == 0)) { @@ -83,16 +83,16 @@ function admin_import() libxml_use_internal_errors(true); if (simplexml_load_file($import_file) === false) { $valid = false; - error(_('No valid xml/xcal file provided.')); + error(__('No valid xml/xcal file provided.')); unlink($import_file); } } else { $valid = false; - error(_('File upload went wrong.')); + error(__('File upload went wrong.')); } } else { $valid = false; - error(_('Please provide some data.')); + error(__('Please provide some data.')); } } @@ -107,23 +107,23 @@ function admin_import() ); } else { $html .= div('well well-sm text-center', [ - _('File Upload') + __('File Upload') . mute(glyph('arrow-right')) - . mute(_('Validation')) + . mute(__('Validation')) . mute(glyph('arrow-right')) - . mute(_('Import')) + . mute(__('Import')) ]) . div('row', [ div('col-md-offset-3 col-md-6', [ form([ form_info( '', - _('This import will create/update/delete rooms and shifts by given FRAB-export file. The needed file format is xcal.') + __('This import will create/update/delete rooms and shifts by given FRAB-export file. The needed file format is xcal.') ), - form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id), - form_spinner('add_minutes_start', _('Add minutes to start'), $add_minutes_start), - form_spinner('add_minutes_end', _('Add minutes to end'), $add_minutes_end), - form_file('xcal_file', _('xcal-File (.xcal)')), - form_submit('submit', _('Import')) + form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id), + form_spinner('add_minutes_start', __('Add minutes to start'), $add_minutes_start), + form_spinner('add_minutes_end', __('Add minutes to end'), $add_minutes_end), + form_file('xcal_file', __('xcal-File (.xcal)')), + form_submit('submit', __('Import')) ]) ]) ]); @@ -132,28 +132,28 @@ function admin_import() case 'check': if (!file_exists($import_file)) { - error(_('Missing import file.')); + error(__('Missing import file.')); redirect(page_link_to('admin_import')); } if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) { $shifttype_id = $request->input('shifttype_id'); } else { - error(_('Please select a shift type.')); + error(__('Please select a shift type.')); redirect(page_link_to('admin_import')); } if ($request->has('add_minutes_start') && is_numeric(trim($request->input('add_minutes_start')))) { $add_minutes_start = trim($request->input('add_minutes_start')); } else { - error(_('Please enter an amount of minutes to add to a talk\'s begin.')); + error(__('Please enter an amount of minutes to add to a talk\'s begin.')); redirect(page_link_to('admin_import')); } if ($request->has('add_minutes_end') && is_numeric(trim($request->input(('add_minutes_end'))))) { $add_minutes_end = trim($request->input('add_minutes_end')); } else { - error(_('Please enter an amount of minutes to add to a talk\'s end.')); + error(__('Please enter an amount of minutes to add to a talk\'s end.')); redirect(page_link_to('admin_import')); } @@ -168,53 +168,53 @@ function admin_import() $html .= div( 'well well-sm text-center', [ - '' . _('File Upload') . glyph('ok-circle') . '' + '' . __('File Upload') . glyph('ok-circle') . '' . mute(glyph('arrow-right')) - . _('Validation') + . __('Validation') . mute(glyph('arrow-right')) - . mute(_('Import')) + . mute(__('Import')) ] ) . form( [ div('row', [ div('col-sm-6', [ - '

' . _('Rooms to create') . '

', - table(_('Name'), $rooms_new) + '

' . __('Rooms to create') . '

', + table(__('Name'), $rooms_new) ]), div('col-sm-6', [ - '

' . _('Rooms to delete') . '

', - table(_('Name'), $rooms_deleted) + '

' . __('Rooms to delete') . '

', + table(__('Name'), $rooms_deleted) ]) ]), - '

' . _('Shifts to create') . '

', + '

' . __('Shifts to create') . '

', table([ - 'day' => _('Day'), - 'start' => _('Start'), - 'end' => _('End'), - 'shifttype' => _('Shift type'), - 'title' => _('Title'), - 'room' => _('Room') + 'day' => __('Day'), + 'start' => __('Start'), + 'end' => __('End'), + 'shifttype' => __('Shift type'), + 'title' => __('Title'), + 'room' => __('Room') ], shifts_printable($events_new, $shifttypes)), - '

' . _('Shifts to update') . '

', + '

' . __('Shifts to update') . '

', table([ - 'day' => _('Day'), - 'start' => _('Start'), - 'end' => _('End'), - 'shifttype' => _('Shift type'), - 'title' => _('Title'), - 'room' => _('Room') + 'day' => __('Day'), + 'start' => __('Start'), + 'end' => __('End'), + 'shifttype' => __('Shift type'), + 'title' => __('Title'), + 'room' => __('Room') ], shifts_printable($events_updated, $shifttypes)), - '

' . _('Shifts to delete') . '

', + '

' . __('Shifts to delete') . '

', table([ - 'day' => _('Day'), - 'start' => _('Start'), - 'end' => _('End'), - 'shifttype' => _('Shift type'), - 'title' => _('Title'), - 'room' => _('Room') + 'day' => __('Day'), + 'start' => __('Start'), + 'end' => __('End'), + 'shifttype' => __('Shift type'), + 'title' => __('Title'), + 'room' => __('Room') ], shifts_printable($events_deleted, $shifttypes)), - form_submit('submit', _('Import')) + form_submit('submit', __('Import')) ], page_link_to('admin_import', [ 'step' => 'import', @@ -227,7 +227,7 @@ function admin_import() case 'import': if (!file_exists($import_file)) { - error(_('Missing import file.')); + error(__('Missing import file.')); redirect(page_link_to('admin_import')); } @@ -238,21 +238,21 @@ function admin_import() if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) { $shifttype_id = $request->input('shifttype_id'); } else { - error(_('Please select a shift type.')); + error(__('Please select a shift type.')); redirect(page_link_to('admin_import')); } if ($request->has('add_minutes_start') && is_numeric(trim($request->input('add_minutes_start')))) { $add_minutes_start = trim($request->input('add_minutes_start')); } else { - error(_('Please enter an amount of minutes to add to a talk\'s begin.')); + error(__('Please enter an amount of minutes to add to a talk\'s begin.')); redirect(page_link_to('admin_import')); } if ($request->has('add_minutes_end') && is_numeric(trim($request->input('add_minutes_end')))) { $add_minutes_end = trim($request->input('add_minutes_end')); } else { - error(_('Please enter an amount of minutes to add to a talk\'s end.')); + error(__('Please enter an amount of minutes to add to a talk\'s end.')); redirect(page_link_to('admin_import')); } @@ -288,12 +288,12 @@ function admin_import() unlink($import_file); $html .= div('well well-sm text-center', [ - '' . _('File Upload') . glyph('ok-circle') . '' + '' . __('File Upload') . glyph('ok-circle') . '' . mute(glyph('arrow-right')) - . '' . _('Validation') . glyph('ok-circle') . '' + . '' . __('Validation') . glyph('ok-circle') . '' . mute(glyph('arrow-right')) - . '' . _('Import') . glyph('ok-circle') . '' - ]) . success(_('It\'s done!'), true); + . '' . __('Import') . glyph('ok-circle') . '' + ]) . success(__('It\'s done!'), true); break; default: redirect(page_link_to('admin_import')); diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index 694b1d5a..f80f59d2 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -5,7 +5,7 @@ */ function admin_log_title() { - return _('Log'); + return __('Log'); } /** @@ -26,8 +26,8 @@ function admin_log() return page_with_title(admin_log_title(), [ msg(), form([ - form_text('keyword', _('Search'), $filter), - form_submit(_('Search'), 'Go') + form_text('keyword', __('Search'), $filter), + form_submit(__('Search'), 'Go') ]), table([ 'date' => 'Time', diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php index 7f912773..8a3fe9c2 100644 --- a/includes/pages/admin_news.php +++ b/includes/pages/admin_news.php @@ -14,7 +14,7 @@ function admin_news() redirect(page_link_to('news')); } - $html = '

' . _('Edit news entry') . '

' . msg(); + $html = '

' . __('Edit news entry') . '

' . msg(); if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { $news_id = $request->input('id'); } else { @@ -34,19 +34,19 @@ function admin_news() && strip_tags($news['Text']) != $news['Text'] ) { $html .= warning( - _('This message contains HTML. After saving the post some formatting will be lost!'), + __('This message contains HTML. After saving the post some formatting will be lost!'), true ); } $html .= form( [ - form_info(_('Date'), date('Y-m-d H:i', $news['Datum'])), - form_info(_('Author'), User_Nick_render($user_source)), - form_text('eBetreff', _('Subject'), $news['Betreff']), - form_textarea('eText', _('Message'), $news['Text']), - form_checkbox('eTreffen', _('Meeting'), $news['Treffen'] == 1, 1), - form_submit('submit', _('Save')) + form_info(__('Date'), date('Y-m-d H:i', $news['Datum'])), + form_info(__('Author'), User_Nick_render($user_source)), + form_text('eBetreff', __('Subject'), $news['Betreff']), + form_textarea('eText', __('Message'), $news['Text']), + form_checkbox('eTreffen', __('Meeting'), $news['Treffen'] == 1, 1), + form_submit('submit', __('Save')) ], page_link_to('admin_news', ['action' => 'save', 'id' => $news_id]) ); @@ -54,7 +54,7 @@ function admin_news() $html .= '' - . ' ' . _('Delete') + . ' ' . __('Delete') . ''; break; @@ -84,14 +84,14 @@ function admin_news() ); engelsystem_log('News updated: ' . $request->postData('eBetreff')); - success(_('News entry updated.')); + success(__('News entry updated.')); redirect(page_link_to('news')); break; case 'delete': DB::delete('DELETE FROM `News` WHERE `ID`=? LIMIT 1', [$news_id]); engelsystem_log('News deleted: ' . $news['Betreff']); - success(_('News entry deleted.')); + success(__('News entry deleted.')); redirect(page_link_to('news')); break; default: diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php index 2d058b0d..b4a956d5 100644 --- a/includes/pages/admin_questions.php +++ b/includes/pages/admin_questions.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_questions_title() { - return _('Answer questions'); + return __('Answer questions'); } /** @@ -25,7 +25,7 @@ function admin_new_questions() if ($new_messages > 0) { return '' - . _('There are unanswered questions!') + . __('There are unanswered questions!') . ''; } } @@ -53,11 +53,11 @@ function admin_questions() 'question' => str_replace("\n", '
', $question['Question']), 'answer' => form([ form_textarea('answer', '', ''), - form_submit('submit', _('Save')) + form_submit('submit', __('Save')) ], page_link_to('admin_questions', ['action' => 'answer', 'id' => $question['QID']])), 'actions' => button( page_link_to('admin_questions', ['action' => 'delete', 'id' => $question['QID']]), - _('delete'), + __('delete'), 'btn-xs' ) ]; @@ -75,26 +75,26 @@ function admin_questions() 'answer' => str_replace("\n", '
', $question['Answer']), 'actions' => button( page_link_to('admin_questions', ['action' => 'delete', 'id' => $question['QID']]), - _('delete'), + __('delete'), 'btn-xs' ) ]; } return page_with_title(admin_questions_title(), [ - '

' . _('Unanswered questions') . '

', + '

' . __('Unanswered questions') . '

', table([ - 'from' => _('From'), - 'question' => _('Question'), - 'answer' => _('Answer'), + 'from' => __('From'), + 'question' => __('Question'), + 'answer' => __('Answer'), 'actions' => '' ], $unanswered_questions_table), - '

' . _('Answered questions') . '

', + '

' . __('Answered questions') . '

', table([ - 'from' => _('From'), - 'question' => _('Question'), - 'answered_by' => _('Answered by'), - 'answer' => _('Answer'), + 'from' => __('From'), + 'question' => __('Question'), + 'answered_by' => __('Answered by'), + 'answer' => __('Answer'), 'actions' => '' ], $answered_questions_table) ]); diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index bbbc24ae..5be3f926 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -4,7 +4,7 @@ */ function admin_rooms_title() { - return _('Rooms'); + return __('Rooms'); } /** @@ -24,12 +24,12 @@ function admin_rooms() 'actions' => table_buttons([ button( page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room['RID']]), - _('edit'), + __('edit'), 'btn-xs' ), button( page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room['RID']]), - _('delete'), + __('delete'), 'btn-xs' ) ]) @@ -79,13 +79,13 @@ function admin_rooms() $result = Room_validate_name(strip_request_item('name'), $room_id); if (!$result->isValid()) { $valid = false; - $msg .= error(_('This name is already in use.'), true); + $msg .= error(__('This name is already in use.'), true); } else { $name = $result->getValue(); } } else { $valid = false; - $msg .= error(_('Please enter a name.'), true); + $msg .= error(__('Please enter a name.'), true); } $from_frab = $request->has('from_frab'); @@ -110,7 +110,7 @@ function admin_rooms() } else { $valid = false; $msg .= error(sprintf( - _('Please enter needed angels for type %s.'), + __('Please enter needed angels for type %s.'), $angeltype ), true); } @@ -139,7 +139,7 @@ function admin_rooms() 'Set needed angeltypes of room ' . $name . ' to: ' . join(', ', $needed_angeltype_info) ); - success(_('Room saved.')); + success(__('Room saved.')); redirect(page_link_to('admin_rooms')); } } @@ -152,29 +152,29 @@ function admin_rooms() return page_with_title(admin_rooms_title(), [ buttons([ - button(page_link_to('admin_rooms'), _('back'), 'back') + button(page_link_to('admin_rooms'), __('back'), 'back') ]), $msg, form([ div('row', [ div('col-md-6', [ - form_text('name', _('Name'), $name), - form_checkbox('from_frab', _('Frab import'), $from_frab), - form_text('map_url', _('Map URL'), $map_url), - form_info('', _('The map url is used to display an iframe on the room page.')), - form_textarea('description', _('Description'), $description), - form_info('', _('Please use markdown for the description.')), + form_text('name', __('Name'), $name), + form_checkbox('from_frab', __('Frab import'), $from_frab), + form_text('map_url', __('Map URL'), $map_url), + form_info('', __('The map url is used to display an iframe on the room page.')), + form_textarea('description', __('Description'), $description), + form_info('', __('Please use markdown for the description.')), ]), div('col-md-6', [ div('row', [ div('col-md-12', [ - form_info(_('Needed angels:')) + form_info(__('Needed angels:')) ]), join($angeltypes_count_form) ]) ]) ]), - form_submit('submit', _('Save')) + form_submit('submit', __('Save')) ]) ]); } elseif ($request->input('show') == 'delete') { @@ -182,19 +182,19 @@ function admin_rooms() Room_delete($room_id); engelsystem_log('Room deleted: ' . $name); - success(sprintf(_('Room %s deleted.'), $name)); + success(sprintf(__('Room %s deleted.'), $name)); redirect(page_link_to('admin_rooms')); } return page_with_title(admin_rooms_title(), [ buttons([ - button(page_link_to('admin_rooms'), _('back'), 'back') + button(page_link_to('admin_rooms'), __('back'), 'back') ]), - sprintf(_('Do you want to delete room %s?'), $name), + sprintf(__('Do you want to delete room %s?'), $name), buttons([ button( page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room_id, 'ack' => 1]), - _('Delete'), + __('Delete'), 'delete btn-danger' ) ]) @@ -204,13 +204,13 @@ function admin_rooms() return page_with_title(admin_rooms_title(), [ buttons([ - button(page_link_to('admin_rooms', ['show' => 'edit']), _('add')) + button(page_link_to('admin_rooms', ['show' => 'edit']), __('add')) ]), msg(), table([ - 'name' => _('Name'), - 'from_frab' => _('Frab import'), - 'map_url' => _('Map'), + 'name' => __('Name'), + 'from_frab' => __('Frab import'), + 'map_url' => __('Map'), 'actions' => '' ], $rooms) ]); diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index 3fecbcd5..171fa073 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_shifts_title() { - return _('Create shifts'); + return __('Create shifts'); } /** @@ -55,13 +55,13 @@ function admin_shifts() $shifttype = ShiftType($request->input('shifttype_id')); if (empty($shifttype)) { $valid = false; - error(_('Please select a shift type.')); + error(__('Please select a shift type.')); } else { $shifttype_id = $request->input('shifttype_id'); } } else { $valid = false; - error(_('Please select a shift type.')); + error(__('Please select a shift type.')); } // Name/Bezeichnung der Schicht, darf leer sein @@ -77,26 +77,26 @@ function admin_shifts() } else { $valid = false; $rid = $rooms[0]['RID']; - error(_('Please select a location.')); + error(__('Please select a location.')); } if ($request->has('start') && $tmp = parse_date('Y-m-d H:i', $request->input('start'))) { $start = $tmp; } else { $valid = false; - error(_('Please select a start time.')); + error(__('Please select a start time.')); } if ($request->has('end') && $tmp = parse_date('Y-m-d H:i', $request->input('end'))) { $end = $tmp; } else { $valid = false; - error(_('Please select an end time.')); + error(__('Please select an end time.')); } if ($start >= $end) { $valid = false; - error(_('The shifts end has to be after its start.')); + error(__('The shifts end has to be after its start.')); } if ($request->has('mode')) { @@ -108,7 +108,7 @@ function admin_shifts() $length = trim($request->input('length')); } else { $valid = false; - error(_('Please enter a shift duration in minutes.')); + error(__('Please enter a shift duration in minutes.')); } } elseif ($request->input('mode') == 'variable') { if ( @@ -125,12 +125,12 @@ function admin_shifts() ); } else { $valid = false; - error(_('Please split the shift-change hours by colons.')); + error(__('Please split the shift-change hours by colons.')); } } } else { $valid = false; - error(_('Please select a mode.')); + error(__('Please select a mode.')); } if ($request->has('angelmode')) { @@ -143,21 +143,21 @@ function admin_shifts() $needed_angel_types[$type['id']] = trim($request->input('type_' . $type['id'], 0)); } else { $valid = false; - error(sprintf(_('Please check the needed angels for team %s.'), $type['name'])); + error(sprintf(__('Please check the needed angels for team %s.'), $type['name'])); } } if (array_sum($needed_angel_types) == 0) { $valid = false; - error(_('There are 0 angels needed. Please enter the amounts of needed angels.')); + error(__('There are 0 angels needed. Please enter the amounts of needed angels.')); } } else { $valid = false; - error(_('Please select a mode for needed angels.')); + error(__('Please select a mode for needed angels.')); } } else { $valid = false; - error(_('Please select needed angels.')); + error(__('Please select needed angels.')); } // Beim Zurück-Knopf das Formular zeigen @@ -285,7 +285,7 @@ function admin_shifts() foreach ($needed_angel_types as $type_id => $count) { $hidden_types .= form_hidden('type_' . $type_id, $count); } - return page_with_title(_('Preview'), [ + return page_with_title(__('Preview'), [ form([ $hidden_types, form_hidden('shifttype_id', $shifttype_id), @@ -297,13 +297,13 @@ function admin_shifts() form_hidden('length', $length), form_hidden('change_hours', implode(', ', $change_hours)), form_hidden('angelmode', $angelmode), - form_submit('back', _('back')), + form_submit('back', __('back')), table([ - 'timeslot' => _('Time and location'), - 'title' => _('Type and title'), - 'needed_angels' => _('Needed angels') + 'timeslot' => __('Time and location'), + 'title' => __('Type and title'), + 'needed_angels' => __('Needed angels') ], $shifts_table), - form_submit('submit', _('Save')) + form_submit('submit', __('Save')) ]) ]); } @@ -379,48 +379,48 @@ function admin_shifts() return page_with_title(admin_shifts_title(), [ msg(), form([ - form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id), - form_text('title', _('Title'), $title), - form_select('rid', _('Room'), $room_array, $rid), + form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id), + form_text('title', __('Title'), $title), + form_select('rid', __('Room'), $room_array, $rid), div('row', [ div('col-md-6', [ - form_text('start', _('Start'), date('Y-m-d H:i', $start)), - form_text('end', _('End'), date('Y-m-d H:i', $end)), - form_info(_('Mode'), ''), - form_radio('mode', _('Create one shift'), $mode == 'single', 'single'), - form_radio('mode', _('Create multiple shifts'), $mode == 'multi', 'multi'), + form_text('start', __('Start'), date('Y-m-d H:i', $start)), + form_text('end', __('End'), date('Y-m-d H:i', $end)), + form_info(__('Mode'), ''), + form_radio('mode', __('Create one shift'), $mode == 'single', 'single'), + form_radio('mode', __('Create multiple shifts'), $mode == 'multi', 'multi'), form_text( 'length', - _('Length'), + __('Length'), $request->has('length') ? $request->input('length') : '120' ), form_radio( 'mode', - _('Create multiple shifts with variable length'), + __('Create multiple shifts with variable length'), $mode == 'variable', 'variable' ), form_text( 'change_hours', - _('Shift change hours'), + __('Shift change hours'), $request->has('change_hours') ? $request->input('input') : '00, 04, 08, 10, 12, 14, 16, 18, 20, 22' ) ]), div('col-md-6', [ - form_info(_('Needed angels'), ''), + form_info(__('Needed angels'), ''), form_radio( 'angelmode', - _('Take needed angels from room settings'), + __('Take needed angels from room settings'), $angelmode == 'location', 'location' ), form_radio( 'angelmode', - _('The following angels are needed'), + __('The following angels are needed'), $angelmode == 'manually', 'manually' ), @@ -429,7 +429,7 @@ function admin_shifts() ]) ]) ]), - form_submit('preview', _('Preview')) + form_submit('preview', __('Preview')) ]) ]); } diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 2841c278..1eb1f08f 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function admin_user_title() { - return _('All Angels'); + return __('All Angels'); } /** @@ -28,7 +28,7 @@ function admin_user() if (!$request->has('action')) { $user_source = User($user_id); if (empty($user_source)) { - error(_('This user does not exist.')); + error(__('This user does not exist.')); redirect(users_link()); } @@ -61,11 +61,11 @@ function admin_user() } $html .= " jabber" . '' . "\n"; $html .= ' Size' - . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size'], _('Please select...')) . '' . "\n"; + . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size'], __('Please select...')) . '' . "\n"; $options = [ - '1' => _('Yes'), - '0' => _('No') + '1' => __('Yes'), + '0' => __('No') ]; // Gekommen? @@ -78,7 +78,7 @@ function admin_user() // Aktiv erzwingen if (in_array('admin_active', $privileges)) { - $html .= ' ' . _('Force active') . '' . "\n"; + $html .= ' ' . __('Force active') . '' . "\n"; $html .= html_options('force_active', $options, $user_source['force_active']) . '' . "\n"; } @@ -97,7 +97,7 @@ function admin_user() $html .= '
'; - $html .= form_info('', _('Please visit the angeltypes page or the users profile to manage users angeltypes.')); + $html .= form_info('', __('Please visit the angeltypes page or the users profile to manage users angeltypes.')); $html .= 'Hier kannst Du das Passwort dieses Engels neu setzen:
"; @@ -312,7 +312,7 @@ function admin_user() } } - return page_with_title(_('Edit user'), [ + return page_with_title(__('Edit user'), [ $html ]); } diff --git a/includes/pages/guest_credits.php b/includes/pages/guest_credits.php index ecfa8f7c..5f90c97c 100644 --- a/includes/pages/guest_credits.php +++ b/includes/pages/guest_credits.php @@ -5,7 +5,7 @@ */ function credits_title() { - return _('Credits'); + return __('Credits'); } /** diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index d23d9f96..fbad8ff6 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function login_title() { - return _('Login'); + return __('Login'); } /** @@ -15,7 +15,7 @@ function login_title() */ function register_title() { - return _('Register'); + return __('Register'); } /** @@ -23,7 +23,7 @@ function register_title() */ function logout_title() { - return _('Logout'); + return __('Logout'); } /** @@ -70,7 +70,7 @@ function guest_register() } if (!in_array('register', $privileges) || (!isset($user) && !config('registration_enabled'))) { - error(_('Registration is disabled.')); + error(__('Registration is disabled.')); return page_with_title(register_title(), [ msg(), @@ -84,12 +84,12 @@ function guest_register() $nick = User_validate_Nick($request->input('nick')); if (count(DB::select('SELECT `UID` FROM `User` WHERE `Nick`=? LIMIT 1', [$nick])) > 0) { $valid = false; - $msg .= error(sprintf(_('Your nick "%s" already exists.'), $nick), true); + $msg .= error(sprintf(__('Your nick "%s" already exists.'), $nick), true); } } else { $valid = false; $msg .= error(sprintf( - _('Your nick "%s" is too short (min. 2 characters).'), + __('Your nick "%s" is too short (min. 2 characters).'), User_validate_Nick($request->input('nick')) ), true); } @@ -98,11 +98,11 @@ function guest_register() $mail = strip_request_item('mail'); if (!check_email($mail)) { $valid = false; - $msg .= error(_('E-mail address is not correct.'), true); + $msg .= error(__('E-mail address is not correct.'), true); } } else { $valid = false; - $msg .= error(_('Please enter your e-mail.'), true); + $msg .= error(__('Please enter your e-mail.'), true); } if ($request->has('email_shiftinfo')) { @@ -117,7 +117,7 @@ function guest_register() $jabber = strip_request_item('jabber'); if (!check_email($jabber)) { $valid = false; - $msg .= error(_('Please check your jabber account information.'), true); + $msg .= error(__('Please check your jabber account information.'), true); } } @@ -126,19 +126,19 @@ function guest_register() $tshirt_size = $request->input('tshirt_size'); } else { $valid = false; - $msg .= error(_('Please select your shirt size.'), true); + $msg .= error(__('Please select your shirt size.'), true); } } if ($request->has('password') && strlen($request->postData('password')) >= $min_password_length) { if ($request->postData('password') != $request->postData('password2')) { $valid = false; - $msg .= error(_('Your passwords don\'t match.'), true); + $msg .= error(__('Your passwords don\'t match.'), true); } } else { $valid = false; $msg .= error(sprintf( - _('Your password is too short (please use at least %s characters).'), + __('Your password is too short (please use at least %s characters).'), $min_password_length ), true); } @@ -149,11 +149,11 @@ function guest_register() $planned_arrival_date = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); + error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); } } else { $valid = false; - error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); + error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); } $selected_angel_types = []; @@ -181,7 +181,7 @@ function guest_register() $dect = strip_request_item('dect'); } else { $valid = false; - error(_('For dect numbers are only 5 digits allowed.')); + error(__('For dect numbers are only 5 digits allowed.')); } } if ($request->has('mobile')) { @@ -265,7 +265,7 @@ function guest_register() 'User ' . User_Nick_render(User($user_id)) . ' signed up as: ' . join(', ', $user_angel_types_info) ); - success(_('Angel registration successful!')); + success(__('Angel registration successful!')); // User is already logged in - that means a supporter has registered an angel. Return to register page. if (isset($user)) { @@ -293,7 +293,7 @@ function guest_register() } return page_with_title(register_title(), [ - _('By completing this form you\'re registering as a Chaos-Angel. This script will create you an account in the angel task scheduler.'), + __('By completing this form you\'re registering as a Chaos-Angel. This script will create you an account in the angel task scheduler.'), $msg, msg(), form([ @@ -301,18 +301,18 @@ function guest_register() div('col-md-6', [ div('row', [ div('col-sm-4', [ - form_text('nick', _('Nick') . ' ' . entry_required(), $nick) + form_text('nick', __('Nick') . ' ' . entry_required(), $nick) ]), div('col-sm-8', [ - form_email('mail', _('E-Mail') . ' ' . entry_required(), $mail), + form_email('mail', __('E-Mail') . ' ' . entry_required(), $mail), form_checkbox( 'email_shiftinfo', - _('The engelsystem is allowed to send me an email (e.g. when my shifts change)'), + __('The engelsystem is allowed to send me an email (e.g. when my shifts change)'), $email_shiftinfo ), form_checkbox( 'email_by_human_allowed', - _('Humans are allowed to send me an email (e.g. for ticket vouchers)'), + __('Humans are allowed to send me an email (e.g. for ticket vouchers)'), $email_by_human_allowed ) ]) @@ -321,72 +321,72 @@ function guest_register() div('col-sm-6', [ form_date( 'planned_arrival_date', - _('Planned date of arrival') . ' ' . entry_required(), + __('Planned date of arrival') . ' ' . entry_required(), $planned_arrival_date, $buildup_start_date, $teardown_end_date ) ]), div('col-sm-6', [ $enable_tshirt_size ? form_select('tshirt_size', - _('Shirt size') . ' ' . entry_required(), - $tshirt_sizes, $tshirt_size, _('Please select...')) : '' + __('Shirt size') . ' ' . entry_required(), + $tshirt_sizes, $tshirt_size, __('Please select...')) : '' ]) ]), div('row', [ div('col-sm-6', [ - form_password('password', _('Password') . ' ' . entry_required()) + form_password('password', __('Password') . ' ' . entry_required()) ]), div('col-sm-6', [ - form_password('password2', _('Confirm password') . ' ' . entry_required()) + form_password('password2', __('Confirm password') . ' ' . entry_required()) ]) ]), form_checkboxes( 'angel_types', - _('What do you want to do?') . sprintf( + __('What do you want to do?') . sprintf( ' (%s)', page_link_to('angeltypes', ['action' => 'about']), - _('Description of job types') + __('Description of job types') ), $angel_types, $selected_angel_types ), form_info( '', - _('Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section.') + __('Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section.') ) ]), div('col-md-6', [ div('row', [ div('col-sm-4', [ - form_text('dect', _('DECT'), $dect) + form_text('dect', __('DECT'), $dect) ]), div('col-sm-4', [ - form_text('mobile', _('Mobile'), $mobile) + form_text('mobile', __('Mobile'), $mobile) ]), div('col-sm-4', [ - form_text('tel', _('Phone'), $tel) + form_text('tel', __('Phone'), $tel) ]) ]), - form_text('jabber', _('Jabber'), $jabber), + form_text('jabber', __('Jabber'), $jabber), div('row', [ div('col-sm-6', [ - form_text('prename', _('First name'), $preName) + form_text('prename', __('First name'), $preName) ]), div('col-sm-6', [ - form_text('lastname', _('Last name'), $lastName) + form_text('lastname', __('Last name'), $lastName) ]) ]), div('row', [ div('col-sm-3', [ - form_text('age', _('Age'), $age) + form_text('age', __('Age'), $age) ]), div('col-sm-9', [ - form_text('hometown', _('Hometown'), $hometown) + form_text('hometown', __('Hometown'), $hometown) ]) ]), - form_info(entry_required() . ' = ' . _('Entry required!')) + form_info(entry_required() . ' = ' . __('Entry required!')) ]) ]), - form_submit('submit', _('Register')) + form_submit('submit', __('Register')) ]) ]); } @@ -429,19 +429,19 @@ function guest_login() if ($request->has('password')) { if (!verify_password($request->postData('password'), $login_user['Passwort'], $login_user['UID'])) { $valid = false; - error(_('Your password is incorrect. Please try it again.')); + error(__('Your password is incorrect. Please try it again.')); } } else { $valid = false; - error(_('Please enter a password.')); + error(__('Please enter a password.')); } } else { $valid = false; - error(_('No user was found with that Nickname. Please try again. If you are still having problems, ask a Dispatcher.')); + error(__('No user was found with that Nickname. Please try again. If you are still having problems, ask a Dispatcher.')); } } else { $valid = false; - error(_('Please enter a nickname.')); + error(__('Please enter a nickname.')); } if ($valid && !empty($login_user)) { @@ -463,21 +463,21 @@ function guest_login() div('col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4', [ div('panel panel-primary first', [ div('panel-heading', [ - ' ' . _('Login') + ' ' . __('Login') ]), div('panel-body', [ msg(), form([ - form_text_placeholder('nick', _('Nick'), $nick), - form_password_placeholder('password', _('Password')), - form_submit('submit', _('Login')), + form_text_placeholder('nick', __('Nick'), $nick), + form_password_placeholder('password', __('Password')), + form_submit('submit', __('Login')), !$valid ? buttons([ - button(page_link_to('user_password_recovery'), _('I forgot my password')) + button(page_link_to('user_password_recovery'), __('I forgot my password')) ]) : '' ]) ]), div('panel-footer', [ - glyph('info-sign') . _('Please note: You have to activate cookies!') + glyph('info-sign') . __('Please note: You have to activate cookies!') ]) ]) ]) @@ -488,12 +488,12 @@ function guest_login() get_register_hint() ]), div('col-sm-6 text-center', [ - heading(_('What can I do?'), 2), - '

' . _('Please read about the jobs you can do to help us.') . '

', + heading(__('What can I do?'), 2), + '

' . __('Please read about the jobs you can do to help us.') . '

', buttons([ button( page_link_to('angeltypes', ['action' => 'about']), - _('Teams/Job description') . ' »' + __('Teams/Job description') . ' »' ) ]) ]) @@ -511,12 +511,12 @@ function get_register_hint() if (in_array('register', $privileges) && config('registration_enabled')) { return join('', [ - '

' . _('Please sign up, if you want to help us!') . '

', + '

' . __('Please sign up, if you want to help us!') . '

', buttons([ button(page_link_to('register'), register_title() . ' »') ]) ]); } - return error(_('Registration is disabled.'), true); + return error(__('Registration is disabled.'), true); } diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php index 06ae7e75..0738f433 100644 --- a/includes/pages/user_messages.php +++ b/includes/pages/user_messages.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function messages_title() { - return _('Messages'); + return __('Messages'); } /** @@ -44,7 +44,7 @@ function user_messages() ); $to_select_data = [ - '' => _('Select recipient...') + '' => __('Select recipient...') ]; foreach ($users as $u) { @@ -73,7 +73,7 @@ function user_messages() 'from' => User_Nick_render($user), 'to' => $to_select, 'text' => form_textarea('text', '', ''), - 'actions' => form_submit('submit', _('Save')) + 'actions' => form_submit('submit', __('Save')) ] ]; @@ -93,14 +93,14 @@ function user_messages() if ($message['isRead'] == 'N') { $messages_table_entry['actions'] = button( page_link_to('user_messages', ['action' => 'read', 'id' => $message['id']]), - _('mark as read'), + __('mark as read'), 'btn-xs' ); } } else { $messages_table_entry['actions'] = button( page_link_to('user_messages', ['action' => 'delete', 'id' => $message['id']]), - _('delete message'), + __('delete message'), 'btn-xs' ); } @@ -109,14 +109,14 @@ function user_messages() return page_with_title(messages_title(), [ msg(), - sprintf(_('Hello %s, here can you leave messages for other angels'), User_Nick_render($user)), + sprintf(__('Hello %s, here can you leave messages for other angels'), User_Nick_render($user)), form([ table([ - 'new' => _('New'), - 'timestamp' => _('Date'), - 'from' => _('Transmitted'), - 'to' => _('Recipient'), - 'text' => _('Message'), + 'new' => __('New'), + 'timestamp' => __('Date'), + 'from' => __('Transmitted'), + 'to' => __('Recipient'), + 'text' => __('Message'), 'actions' => '' ], $messages_table) ], page_link_to('user_messages', ['action' => 'send'])) @@ -127,7 +127,7 @@ function user_messages() if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { $message_id = $request->input('id'); } else { - return error(_('Incomplete call, missing Message ID.'), true); + return error(__('Incomplete call, missing Message ID.'), true); } $message = DB::selectOne( @@ -141,7 +141,7 @@ function user_messages() ); redirect(page_link_to('user_messages')); } else { - return error(_('No Message found.'), true); + return error(__('No Message found.'), true); } break; @@ -149,7 +149,7 @@ function user_messages() if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { $message_id = $request->input('id'); } else { - return error(_('Incomplete call, missing Message ID.'), true); + return error(__('Incomplete call, missing Message ID.'), true); } $message = DB::selectOne( @@ -160,7 +160,7 @@ function user_messages() DB::delete('DELETE FROM `Messages` WHERE `id`=? LIMIT 1', [$message_id]); redirect(page_link_to('user_messages')); } else { - return error(_('No Message found.'), true); + return error(__('No Message found.'), true); } break; @@ -169,12 +169,12 @@ function user_messages() if (Message_send($request->input('to'), $request->input('text'))) { redirect(page_link_to('user_messages')); } else { - return error(_('Transmitting was terminated with an Error.'), true); + return error(__('Transmitting was terminated with an Error.'), true); } break; default: - return error(_('Wrong action.'), true); + return error(__('Wrong action.'), true); } } diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 5819f5c6..e679d788 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function myshifts_title() { - return _('My shifts'); + return __('My shifts'); } /** @@ -35,15 +35,15 @@ function user_myshifts() if ($request->has('reset')) { if ($request->input('reset') == 'ack') { User_reset_api_key($user); - success(_('Key changed.')); + success(__('Key changed.')); redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']])); } - return page_with_title(_('Reset API key'), [ + return page_with_title(__('Reset API key'), [ error( - _('If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports.'), + __('If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports.'), true ), - button(page_link_to('user_myshifts', ['reset' => 'ack']), _('Continue'), 'btn-danger') + button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger') ]); } elseif ($request->has('edit') && preg_match('/^\d+$/', $request->input('edit'))) { $shift_entry_id = $request->input('edit'); @@ -82,7 +82,7 @@ function user_myshifts() $freeload_comment = strip_request_item_nl('freeload_comment'); if ($freeloaded && $freeload_comment == '') { $valid = false; - error(_('Please enter a freeload comment!')); + error(__('Please enter a freeload comment!')); } } @@ -104,7 +104,7 @@ function user_myshifts() . ' with comment ' . $comment . '. Freeloaded: ' . ($freeloaded ? 'YES Comment: ' . $freeload_comment : 'NO') ); - success(_('Shift saved.')); + success(__('Shift saved.')); redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']])); } } diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 0ec93627..f95b6ae8 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function user_news_comments_title() { - return _('News comments'); + return __('News comments'); } /** @@ -15,7 +15,7 @@ function user_news_comments_title() */ function news_title() { - return _('News'); + return __('News'); } /** @@ -23,7 +23,7 @@ function news_title() */ function meetings_title() { - return _('Meetings'); + return __('Meetings'); } /** @@ -117,7 +117,7 @@ function display_news($news) if ($page != 'news_comments') { $html .= ' ' . ' ' - . _('Comments') . ' » ' + . __('Comments') . ' » ' . '' . count(DB::select('SELECT `ID` FROM `NewsComments` WHERE `Refid`=?', [$news['ID']])) . ''; @@ -162,7 +162,7 @@ function user_news_comments() ] ); engelsystem_log('Created news_comment: ' . $text); - $html .= success(_('Entry saved.'), true); + $html .= success(__('Entry saved.'), true); } $html .= display_news($news); @@ -183,13 +183,13 @@ function user_news_comments() $html .= '
'; } - $html .= '

' . _('New Comment:') . '

'; + $html .= '

' . __('New Comment:') . '

'; $html .= form([ - form_textarea('text', _('Message'), ''), - form_submit('submit', _('Save')) + form_textarea('text', __('Message'), ''), + form_submit('submit', __('Save')) ], page_link_to('news_comments', ['nid' => $news['ID']])); } else { - $html .= _('Invalid request.'); + $html .= __('Invalid request.'); } return $html . '
'; @@ -230,7 +230,7 @@ function user_news() ] ); engelsystem_log('Created news: ' . $request->postData('betreff') . ', treffen: ' . $isMeeting); - success(_('Entry saved.')); + success(__('Entry saved.')); redirect(page_link_to('news')); } @@ -269,13 +269,13 @@ function user_news() if (in_array('admin_news', $privileges)) { $html .= '
'; - $html .= '

' . _('Create news:') . '

'; + $html .= '

' . __('Create news:') . '

'; $html .= form([ - form_text('betreff', _('Subject'), ''), - form_textarea('text', _('Message'), ''), - form_checkbox('treffen', _('Meeting'), false, 1), - form_submit('submit', _('Save')) + form_text('betreff', __('Subject'), ''), + form_textarea('text', __('Message'), ''), + form_checkbox('treffen', __('Meeting'), false, 1), + form_submit('submit', __('Save')) ]); } return $html . ''; diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php index 41fbe64d..ea255a3d 100644 --- a/includes/pages/user_questions.php +++ b/includes/pages/user_questions.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function questions_title() { - return _('Ask the Heaven'); + return __('Ask the Heaven'); } /** @@ -50,11 +50,11 @@ function user_questions() [$user['UID'], $question] ); - success(_('You question was saved.')); + success(__('You question was saved.')); redirect(page_link_to('user_questions')); } else { return page_with_title(questions_title(), [ - error(_('Please enter a question!'), true) + error(__('Please enter a question!'), true) ]); } break; @@ -62,7 +62,7 @@ function user_questions() if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { $question_id = $request->input('id'); } else { - return error(_('Incomplete call, missing Question ID.'), true); + return error(__('Incomplete call, missing Question ID.'), true); } $question = DB::selectOne( @@ -77,7 +77,7 @@ function user_questions() redirect(page_link_to('user_questions')); } else { return page_with_title(questions_title(), [ - error(_('No question found.'), true) + error(__('No question found.'), true) ]); } break; diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 930d55d9..d8f6e44b 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -7,7 +7,7 @@ use Engelsystem\Database\DB; */ function settings_title() { - return _('Settings'); + return __('Settings'); } /** @@ -28,11 +28,11 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['email'] = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('E-mail address is not correct.')); + error(__('E-mail address is not correct.')); } } else { $valid = false; - error(_('Please enter your e-mail.')); + error(__('Please enter your e-mail.')); } $user_source['email_shiftinfo'] = $request->has('email_shiftinfo'); @@ -43,7 +43,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['jabber'] = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('Please check your jabber account information.')); + error(__('Please check your jabber account information.')); } } @@ -59,7 +59,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['planned_arrival_date'] = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); + error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.')); } } @@ -69,7 +69,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['planned_departure_date'] = $result->getValue(); if (!$result->isValid()) { $valid = false; - error(_('Please enter your planned date of departure. It should be after your planned arrival date and after buildup start date and before teardown end date.')); + error(__('Please enter your planned date of departure. It should be after your planned arrival date and after buildup start date and before teardown end date.')); } } @@ -82,7 +82,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['DECT'] = strip_request_item('dect', $user_source['DECT']); } else { $valid = false; - error(_('For dect numbers are only 5 digits allowed.')); + error(__('For dect numbers are only 5 digits allowed.')); } $user_source['Handy'] = strip_request_item('mobile', $user_source['Handy']); $user_source['Hometown'] = strip_request_item('hometown', $user_source['Hometown']); @@ -90,7 +90,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) if ($valid) { User_update($user_source); - success(_('Settings saved.')); + success(__('Settings saved.')); redirect(page_link_to('user_settings')); } @@ -109,14 +109,14 @@ function user_settings_password($user_source) !$request->has('password') || !verify_password($request->postData('password'), $user_source['Passwort'], $user_source['UID']) ) { - error(_('-> not OK. Please try again.')); + error(__('-> not OK. Please try again.')); } elseif (strlen($request->postData('new_password')) < config('min_password_length')) { - error(_('Your password is to short (please use at least 6 characters).')); + error(__('Your password is to short (please use at least 6 characters).')); } elseif ($request->postData('new_password') != $request->postData('new_password2')) { - error(_('Your passwords don\'t match.')); + error(__('Your passwords don\'t match.')); } else { set_password($user_source['UID'], $request->postData('new_password')); - success(_('Password saved.')); + success(__('Password saved.')); } redirect(page_link_to('user_settings')); } @@ -151,7 +151,7 @@ function user_settings_theme($user_source, $themes) ] ); - success(_('Theme changed.')); + success(__('Theme changed.')); redirect(page_link_to('user_settings')); } diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 67f6785f..3c1ed6fa 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -8,7 +8,7 @@ use Engelsystem\ShiftsFilter; */ function shifts_title() { - return _('Shifts'); + return __('Shifts'); } /** @@ -99,7 +99,7 @@ function load_rooms() 'SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` ORDER BY `Name`' ); if (empty($rooms)) { - error(_('The administration has not configured any rooms yet.')); + error(__('The administration has not configured any rooms yet.')); redirect(page_link_to('/')); } return $rooms; @@ -118,7 +118,7 @@ function load_days() $days = array_map('array_shift', $days); if (empty($days)) { - error(_('The administration has not configured any shifts yet.')); + error(__('The administration has not configured any shifts yet.')); redirect(page_link_to('/')); } return $days; @@ -132,7 +132,7 @@ function load_types() global $user; if (!count(DB::select('SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0'))) { - error(_('The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.')); + error(__('The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.')); redirect(page_link_to('/')); } $types = DB::select(' @@ -200,11 +200,11 @@ function view_user_shifts() $filled = [ [ 'id' => '1', - 'name' => _('occupied') + 'name' => __('occupied') ], [ 'id' => '0', - 'name' => _('free') + 'name' => __('free') ] ]; $start_day = date('Y-m-d', $shiftsFilter->getStartTime()); @@ -226,7 +226,7 @@ function view_user_shifts() msg(), view(__DIR__ . '/../../templates/pages/user-shifts.html', [ 'title' => shifts_title(), - 'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', _('Rooms')), + 'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', __('Rooms')), 'start_select' => html_select_key( 'start_day', 'start_day', @@ -245,34 +245,34 @@ function view_user_shifts() $types, $shiftsFilter->getTypes(), 'types', - _('Angeltypes') . '1', + __('Angeltypes') . '1', [ button( 'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')', - _('Own') + __('Own') ), ] ), - 'filled_select' => make_select($filled, $shiftsFilter->getFilled(), 'filled', _('Occupancy')), + 'filled_select' => make_select($filled, $shiftsFilter->getFilled(), 'filled', __('Occupancy')), 'task_notice' => '1' - . _('The tasks shown here are influenced by the angeltypes you joined already!') + . __('The tasks shown here are influenced by the angeltypes you joined already!') . ' ' - . _('Description of the jobs.') + . __('Description of the jobs.') . '', 'shifts_table' => msg() . $shiftCalendarRenderer->render(), 'ical_text' => ical_hint(), - 'filter' => _('Filter'), - 'set_yesterday' => _('Yesterday'), - 'set_today' => _('Today'), - 'set_tomorrow' => _('Tomorrow'), - 'set_last_8h' => _('last 8h'), - 'set_last_4h' => _('last 4h'), - 'set_next_4h' => _('next 4h'), - 'set_next_8h' => _('next 8h'), + 'filter' => __('Filter'), + 'set_yesterday' => __('Yesterday'), + 'set_today' => __('Today'), + 'set_tomorrow' => __('Tomorrow'), + 'set_last_8h' => __('last 8h'), + 'set_last_4h' => __('last 4h'), + 'set_next_4h' => __('next 4h'), + 'set_next_8h' => __('next 8h'), 'buttons' => button( public_dashboard_link(), - glyph('dashboard') . _('Public Dashboard') + glyph('dashboard') . __('Public Dashboard') ) ]) ]) @@ -286,9 +286,9 @@ function ical_hint() { global $user; - return heading(_('iCal export'), 2) + return heading(__('iCal export'), 2) . '

' . sprintf( - _('Export your own shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key).'), + __('Export your own shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key).'), page_link_to('ical', ['key' => $user['api_key']]), page_link_to('shifts_json_export', ['key' => $user['api_key']]), page_link_to('user_myshifts', ['reset' => 1]) @@ -321,8 +321,8 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons } $buttons = []; - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', _('All')); - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', _('None')); + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All')); + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None')); $buttons = array_merge($buttons, $additionalButtons); $html .= buttons($buttons); diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 58d4bab3..bb6965ea 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -189,7 +189,7 @@ function make_navigation() } if (count($admin_menu) > 0) { - $menu[] = toolbar_dropdown('', _('Admin'), $admin_menu); + $menu[] = toolbar_dropdown('', __('Admin'), $admin_menu); } return toolbar($menu); @@ -213,7 +213,7 @@ function make_room_navigation($menu) $rooms = Rooms(); $room_menu = []; if (in_array('admin_rooms', $privileges)) { - $room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', _('Manage rooms')); + $room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', __('Manage rooms')); } if (count($room_menu) > 0) { $room_menu[] = toolbar_item_divider(); @@ -222,7 +222,7 @@ function make_room_navigation($menu) $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']); } if (count($room_menu) > 0) { - $menu[] = toolbar_dropdown('map-marker', _('Rooms'), $room_menu); + $menu[] = toolbar_dropdown('map-marker', __('Rooms'), $room_menu); } return $menu; } diff --git a/includes/sys_template.php b/includes/sys_template.php index a988ca7c..8c260140 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -323,7 +323,7 @@ function table($columns, $rows_raw, $data = true) function render_table($columns, $rows, $data = true) { if (count($rows) == 0) { - return info(_('No data found.'), true); + return info(__('No data found.'), true); } $html = ''; diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index 93fa03b5..c64297c2 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -31,15 +31,15 @@ function AngelType_render_membership($user_angeltype) if (!empty($user_angeltype['user_angeltype_id'])) { if ($user_angeltype['restricted']) { if (empty($user_angeltype['confirm_user_id'])) { - return glyph('lock') . _('Unconfirmed'); + return glyph('lock') . __('Unconfirmed'); } elseif ($user_angeltype['supporter']) { - return glyph_bool(true) . _('Supporter'); + return glyph_bool(true) . __('Supporter'); } - return glyph_bool(true) . _('Member'); + return glyph_bool(true) . __('Member'); } elseif ($user_angeltype['supporter']) { - return glyph_bool(true) . _('Supporter'); + return glyph_bool(true) . __('Supporter'); } - return glyph_bool(true) . _('Member'); + return glyph_bool(true) . __('Member'); } return glyph_bool(false); } @@ -50,16 +50,16 @@ function AngelType_render_membership($user_angeltype) */ function AngelType_delete_view($angeltype) { - return page_with_title(sprintf(_('Delete angeltype %s'), $angeltype['name']), [ - info(sprintf(_('Do you want to delete angeltype %s?'), $angeltype['name']), true), + return page_with_title(sprintf(__('Delete angeltype %s'), $angeltype['name']), [ + info(sprintf(__('Do you want to delete angeltype %s?'), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes'), glyph('remove') . _('cancel')), + button(page_link_to('angeltypes'), glyph('remove') . __('cancel')), button( page_link_to( 'angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1] ), - glyph('ok') . _('delete'), + glyph('ok') . __('delete'), 'btn-danger' ) ]) @@ -75,48 +75,48 @@ function AngelType_delete_view($angeltype) */ function AngelType_edit_view($angeltype, $supporter_mode) { - return page_with_title(sprintf(_('Edit %s'), $angeltype['name']), [ + return page_with_title(sprintf(__('Edit %s'), $angeltype['name']), [ buttons([ - button(page_link_to('angeltypes'), _('Angeltypes'), 'back') + button(page_link_to('angeltypes'), __('Angeltypes'), 'back') ]), msg(), form([ $supporter_mode - ? form_info(_('Name'), $angeltype['name']) - : form_text('name', _('Name'), $angeltype['name']), + ? form_info(__('Name'), $angeltype['name']) + : form_text('name', __('Name'), $angeltype['name']), $supporter_mode - ? form_info(_('Restricted'), $angeltype['restricted'] ? _('Yes') : _('No')) - : form_checkbox('restricted', _('Restricted'), $angeltype['restricted']), + ? form_info(__('Restricted'), $angeltype['restricted'] ? __('Yes') : __('No')) + : form_checkbox('restricted', __('Restricted'), $angeltype['restricted']), form_info( '', - _('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).') + __('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).') ), $supporter_mode - ? form_info(_('No Self Sign Up'), $angeltype['no_self_signup'] ? _('Yes') : _('No')) - : form_checkbox('no_self_signup', _('No Self Sign Up'), $angeltype['no_self_signup']), + ? form_info(__('No Self Sign Up'), $angeltype['no_self_signup'] ? __('Yes') : __('No')) + : form_checkbox('no_self_signup', __('No Self Sign Up'), $angeltype['no_self_signup']), $supporter_mode - ? form_info(_('Requires driver license'), + ? form_info(__('Requires driver license'), $angeltype['requires_driver_license'] - ? _('Yes') - : _('No')) + ? __('Yes') + : __('No')) : form_checkbox( 'requires_driver_license', - _('Requires driver license'), + __('Requires driver license'), $angeltype['requires_driver_license']), $supporter_mode - ? form_info(_('Show on dashboard'), $angeltype['show_on_dashboard'] ? _('Yes') : _('No')) - : form_checkbox('show_on_dashboard', _('Show on dashboard'), $angeltype['show_on_dashboard']), - form_textarea('description', _('Description'), $angeltype['description']), - form_info('', _('Please use markdown for the description.')), - heading(_('Contact'), 3), + ? form_info(__('Show on dashboard'), $angeltype['show_on_dashboard'] ? __('Yes') : __('No')) + : form_checkbox('show_on_dashboard', __('Show on dashboard'), $angeltype['show_on_dashboard']), + form_textarea('description', __('Description'), $angeltype['description']), + form_info('', __('Please use markdown for the description.')), + heading(__('Contact'), 3), form_info( '', - _('Primary contact person/desk for user questions.') + __('Primary contact person/desk for user questions.') ), - form_text('contact_name', _('Name'), $angeltype['contact_name']), - form_text('contact_dect', _('DECT'), $angeltype['contact_dect']), - form_text('contact_email', _('E-Mail'), $angeltype['contact_email']), - form_submit('submit', _('Save')) + form_text('contact_name', __('Name'), $angeltype['contact_name']), + form_text('contact_dect', __('DECT'), $angeltype['contact_dect']), + form_text('contact_email', __('E-Mail'), $angeltype['contact_email']), + form_submit('submit', __('Save')) ]) ]); } @@ -135,50 +135,50 @@ function AngelType_edit_view($angeltype, $supporter_mode) function AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user) { $buttons = [ - button(page_link_to('angeltypes'), _('Angeltypes'), 'back') + button(page_link_to('angeltypes'), __('Angeltypes'), 'back') ]; if ($angeltype['requires_driver_license']) { $buttons[] = button( user_driver_license_edit_link($user), - glyph('road') . _('my driving license') + glyph('road') . __('my driving license') ); } if (is_null($user_angeltype)) { $buttons[] = button( page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]), - _('join'), + __('join'), 'add' ); } else { if ($angeltype['requires_driver_license'] && empty($user_driver_license)) { - error(_('This angeltype requires a driver license. Please enter your driver license information!')); + error(__('This angeltype requires a driver license. Please enter your driver license information!')); } if ($angeltype['restricted'] && empty($user_angeltype['confirm_user_id'])) { error(sprintf( - _('You are unconfirmed for this angeltype. Please go to the introduction for %s to get confirmed.'), + __('You are unconfirmed for this angeltype. Please go to the introduction for %s to get confirmed.'), $angeltype['name'] )); } $buttons[] = button( page_link_to('user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id']]), - _('leave') + __('leave') ); } if ($admin_angeltypes || $supporter) { $buttons[] = button( page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype['id']]), - _('edit'), + __('edit'), 'edit' ); } if ($admin_angeltypes) { $buttons[] = button( page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id']]), - _('delete'), + __('delete'), 'delete' ); } @@ -219,7 +219,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a 'user_angeltypes', ['action' => 'confirm', 'user_angeltype_id' => $member['user_angeltype_id']] ), - _('confirm'), + __('confirm'), 'btn-xs' ), button( @@ -227,7 +227,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a 'user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $member['user_angeltype_id']] ), - _('deny'), + __('deny'), 'btn-xs' ) ]); @@ -241,7 +241,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a 'user_angeltype_id' => $member['user_angeltype_id'], 'supporter' => 0 ]), - _('Remove supporter rights'), + __('Remove supporter rights'), 'btn-xs' ) ]); @@ -258,14 +258,14 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a 'user_angeltype_id' => $member['user_angeltype_id'], 'supporter' => 1 ]), - _('Add supporter rights'), 'btn-xs') + __('Add supporter rights'), 'btn-xs') : '', button( page_link_to('user_angeltypes', [ 'action' => 'delete', 'user_angeltype_id' => $member['user_angeltype_id'] ]), - _('remove'), + __('remove'), 'btn-xs' ) ]); @@ -293,21 +293,21 @@ function AngelType_view_table_headers($angeltype, $supporter, $admin_angeltypes) { if ($angeltype['requires_driver_license'] && ($supporter || $admin_angeltypes)) { return [ - 'Nick' => _('Nick'), - 'DECT' => _('DECT'), - 'wants_to_drive' => _('Driver'), - 'has_car' => _('Has car'), - 'has_license_car' => _('Car'), - 'has_license_3_5t_transporter' => _('3,5t Transporter'), - 'has_license_7_5t_truck' => _('7,5t Truck'), - 'has_license_12_5t_truck' => _('12,5t Truck'), - 'has_license_forklift' => _('Forklift'), + 'Nick' => __('Nick'), + 'DECT' => __('DECT'), + 'wants_to_drive' => __('Driver'), + 'has_car' => __('Has car'), + 'has_license_car' => __('Car'), + 'has_license_3_5t_transporter' => __('3,5t Transporter'), + 'has_license_7_5t_truck' => __('7,5t Truck'), + 'has_license_12_5t_truck' => __('12,5t Truck'), + 'has_license_forklift' => __('Forklift'), 'actions' => '' ]; } return [ - 'Nick' => _('Nick'), - 'DECT' => _('DECT'), + 'Nick' => __('Nick'), + 'DECT' => __('DECT'), 'actions' => '' ]; } @@ -341,18 +341,18 @@ function AngelType_view( ShiftCalendarRenderer $shiftCalendarRenderer, $tab ) { - return page_with_title(sprintf(_('Team %s'), $angeltype['name']), [ + return page_with_title(sprintf(__('Team %s'), $angeltype['name']), [ AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user), msg(), tabs([ - _('Info') => AngelType_view_info( + __('Info') => AngelType_view_info( $angeltype, $members, $admin_user_angeltypes, $admin_angeltypes, $supporter ), - _('Shifts') => AngelType_view_shifts( + __('Shifts') => AngelType_view_shifts( $angeltype, $shiftsFilterRenderer, $shiftCalendarRenderer @@ -398,7 +398,7 @@ function AngelType_view_info( $info[] = AngelTypes_render_contact_info($angeltype); } - $info[] = '

' . _('Description') . '

'; + $info[] = '

' . __('Description') . '

'; $parsedown = new Parsedown(); if ($angeltype['description'] != '') { $info[] = '
' . $parsedown->parse($angeltype['description']) . '
'; @@ -413,13 +413,13 @@ function AngelType_view_info( $table_headers = AngelType_view_table_headers($angeltype, $supporter, $admin_angeltypes); if (count($supporters) > 0) { - $info[] = '

' . _('Supporters') . '

'; + $info[] = '

' . __('Supporters') . '

'; $info[] = table($table_headers, $supporters); } if (count($members_confirmed) > 0) { $members_confirmed[] = [ - 'Nick' => _('Sum'), + 'Nick' => __('Sum'), 'DECT' => count($members_confirmed), 'actions' => '' ]; @@ -427,13 +427,13 @@ function AngelType_view_info( if (count($members_unconfirmed) > 0) { $members_unconfirmed[] = [ - 'Nick' => _('Sum'), + 'Nick' => __('Sum'), 'DECT' => count($members_unconfirmed), 'actions' => '' ]; } - $info[] = '

' . _('Members') . '

'; + $info[] = '

' . __('Members') . '

'; if ($admin_user_angeltypes) { $info[] = buttons([ button( @@ -441,7 +441,7 @@ function AngelType_view_info( 'user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']] ), - _('Add'), + __('Add'), 'add' ) ]); @@ -449,15 +449,15 @@ function AngelType_view_info( $info[] = table($table_headers, $members_confirmed); if ($admin_user_angeltypes && $angeltype['restricted'] && count($members_unconfirmed) > 0) { - $info[] = '

' . _('Unconfirmed') . '

'; + $info[] = '

' . __('Unconfirmed') . '

'; $info[] = buttons([ button( page_link_to('user_angeltypes', ['action' => 'confirm_all', 'angeltype_id' => $angeltype['id']]), - glyph('ok') . _('confirm all') + glyph('ok') . __('confirm all') ), button( page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype['id']]), - glyph('remove') . _('deny all') + glyph('remove') . __('deny all') ) ]); $info[] = table($table_headers, $members_unconfirmed); @@ -474,10 +474,10 @@ function AngelType_view_info( */ function AngelTypes_render_contact_info($angeltype) { - return heading(_('Contact'), 3) . description([ - _('Name') => $angeltype['contact_name'], - _('DECT') => $angeltype['contact_dect'], - _('E-Mail') => $angeltype['contact_email'] + return heading(__('Contact'), 3) . description([ + __('Name') => $angeltype['contact_name'], + __('DECT') => $angeltype['contact_dect'], + __('E-Mail') => $angeltype['contact_email'] ]); } @@ -494,15 +494,15 @@ function AngelTypes_list_view($angeltypes, $admin_angeltypes) msg(), buttons([ $admin_angeltypes - ? button(page_link_to('angeltypes', ['action' => 'edit']), _('New angeltype'), 'add') + ? button(page_link_to('angeltypes', ['action' => 'edit']), __('New angeltype'), 'add') : '', - button(page_link_to('angeltypes', ['action' => 'about']), _('Teams/Job description')) + button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description')) ]), table([ - 'name' => _('Name'), - 'restricted' => glyph('lock') . _('Restricted'), - 'no_self_signup' => glyph('share') . _('Self Sign Up Allowed'), - 'membership' => _('Membership'), + 'name' => __('Name'), + 'restricted' => glyph('lock') . __('Restricted'), + 'no_self_signup' => glyph('share') . __('Self Sign Up Allowed'), + 'membership' => __('Membership'), 'actions' => '' ], $angeltypes) ]); @@ -532,12 +532,12 @@ function AngelTypes_about_view_angeltype($angeltype) 'user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $angeltype['user_angeltype_id']] ), - _('leave') + __('leave') ); } else { $buttons[] = button( page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]), - _('join'), + __('join'), 'add' ); } @@ -546,7 +546,7 @@ function AngelTypes_about_view_angeltype($angeltype) if ($angeltype['restricted']) { $html .= info( - _('This angeltype is restricted by double-opt-in by a team supporter. Please show up at the according introduction meetings.'), + __('This angeltype is restricted by double-opt-in by a team supporter. Please show up at the according introduction meetings.'), true ); } @@ -583,17 +583,17 @@ function AngelTypes_about_view($angeltypes, $user_logged_in) $faqUrl = config('faq_url'); if (!empty($faqUrl)) { - $buttons[] = button($faqUrl, _('FAQ'), 'btn-primary'); + $buttons[] = button($faqUrl, __('FAQ'), 'btn-primary'); } $content = [ buttons($buttons), - '

' . _('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '

', + '

' . __('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '

', '
' ]; foreach ($angeltypes as $angeltype) { $content[] = AngelTypes_about_view_angeltype($angeltype); } - return page_with_title(_('Teams/Job description'), $content); + return page_with_title(__('Teams/Job description'), $content); } diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php index fe6de670..2525182a 100644 --- a/includes/view/EventConfig_view.php +++ b/includes/view/EventConfig_view.php @@ -10,7 +10,7 @@ function EventConfig_countdown_page($event_config) { if (empty($event_config)) { return div('col-md-12 text-center', [ - heading(sprintf(_('Welcome to the %s!'), ' ENGELSYSTEM'), 2) + heading(sprintf(__('Welcome to the %s!'), ' ENGELSYSTEM'), 2) ]); } @@ -19,7 +19,7 @@ function EventConfig_countdown_page($event_config) if (!is_null($event_config['event_name'])) { $elements[] = div('col-sm-12 text-center', [ heading(sprintf( - _('Welcome to the %s!'), + __('Welcome to the %s!'), $event_config['event_name'] . ' ENGELSYSTEM' ), 2) ]); @@ -27,33 +27,33 @@ function EventConfig_countdown_page($event_config) if (!is_null($event_config['buildup_start_date']) && time() < $event_config['buildup_start_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ - heading(_('Buildup starts'), 4), + heading(__('Buildup starts'), 4), '%c', - '' . date(_('Y-m-d'), $event_config['buildup_start_date']) . '' + '' . date(__('Y-m-d'), $event_config['buildup_start_date']) . '' ]); } if (!is_null($event_config['event_start_date']) && time() < $event_config['event_start_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ - heading(_('Event starts'), 4), + heading(__('Event starts'), 4), '%c', - '' . date(_('Y-m-d'), $event_config['event_start_date']) . '' + '' . date(__('Y-m-d'), $event_config['event_start_date']) . '' ]); } if (!is_null($event_config['event_end_date']) && time() < $event_config['event_end_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ - heading(_('Event ends'), 4), + heading(__('Event ends'), 4), '%c', - '' . date(_('Y-m-d'), $event_config['event_end_date']) . '' + '' . date(__('Y-m-d'), $event_config['event_end_date']) . '' ]); } if (!is_null($event_config['teardown_end_date']) && time() < $event_config['teardown_end_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ - heading(_('Teardown ends'), 4), + heading(__('Teardown ends'), 4), '%c', - '' . date(_('Y-m-d'), $event_config['teardown_end_date']) . '' + '' . date(__('Y-m-d'), $event_config['teardown_end_date']) . '' ]); } @@ -79,27 +79,27 @@ function EventConfig_info($event_config) && !is_null($event_config['event_end_date']) ) { return sprintf( - _('%s, from %s to %s'), + __('%s, from %s to %s'), $event_config['event_name'], - date(_('Y-m-d'), $event_config['event_start_date']), - date(_('Y-m-d'), $event_config['event_end_date']) + date(__('Y-m-d'), $event_config['event_start_date']), + date(__('Y-m-d'), $event_config['event_end_date']) ); } // Event name, start date are set if (!is_null($event_config['event_name']) && !is_null($event_config['event_start_date'])) { return sprintf( - _('%s, starting %s'), $event_config['event_name'], - date(_('Y-m-d'), $event_config['event_start_date']) + __('%s, starting %s'), $event_config['event_name'], + date(__('Y-m-d'), $event_config['event_start_date']) ); } // Event start+end date are set if (!is_null($event_config['event_start_date']) && !is_null($event_config['event_end_date'])) { return sprintf( - _('Event from %s to %s'), - date(_('Y-m-d'), $event_config['event_start_date']), - date(_('Y-m-d'), $event_config['event_end_date']) + __('Event from %s to %s'), + date(__('Y-m-d'), $event_config['event_start_date']), + date(__('Y-m-d'), $event_config['event_end_date']) ); } @@ -135,26 +135,26 @@ function EventConfig_edit_view( form([ div('row', [ div('col-md-6', [ - form_text('event_name', _('Event Name'), $event_name), - form_info('', _('Event Name is shown on the start page.')), - form_textarea('event_welcome_msg', _('Event Welcome Message'), $event_welcome_msg), + form_text('event_name', __('Event Name'), $event_name), + form_info('', __('Event Name is shown on the start page.')), + form_textarea('event_welcome_msg', __('Event Welcome Message'), $event_welcome_msg), form_info( '', - _('Welcome message is shown after successful registration. You can use markdown.') + __('Welcome message is shown after successful registration. You can use markdown.') ) ]), div('col-md-3 col-xs-6', [ - form_date('buildup_start_date', _('Buildup date'), $buildup_start_date), - form_date('event_start_date', _('Event start date'), $event_start_date) + form_date('buildup_start_date', __('Buildup date'), $buildup_start_date), + form_date('event_start_date', __('Event start date'), $event_start_date) ]), div('col-md-3 col-xs-6', [ - form_date('teardown_end_date', _('Teardown end date'), $teardown_end_date), - form_date('event_end_date', _('Event end date'), $event_end_date) + form_date('teardown_end_date', __('Teardown end date'), $teardown_end_date), + form_date('event_end_date', __('Event end date'), $event_end_date) ]) ]), div('row', [ div('col-md-6', [ - form_submit('submit', _('Save')) + form_submit('submit', __('Save')) ]) ]) ]) diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php index 6fef8f54..2bfca3fa 100644 --- a/includes/view/PublicDashboard_view.php +++ b/includes/view/PublicDashboard_view.php @@ -23,7 +23,7 @@ function public_dashboard_view($stats, $free_shifts) $shift_panels[] = ''; $needed_angels = div('first', [ div('col-md-12', [ - heading(_('Needed angels:'), 1) + heading(__('Needed angels:'), 1) ]), div('container-fluid', [ join($shift_panels) @@ -34,10 +34,10 @@ function public_dashboard_view($stats, $free_shifts) return page([ div('public-dashboard', [ div('first', [ - stats(_('Angels needed in the next 3 hrs'), $stats['needed-3-hours']), - stats(_('Angels needed for nightshifts'), $stats['needed-night']), - stats(_('Angels currently working'), $stats['angels-working'], 'default'), - stats(_('Hours to be worked'), $stats['hours-to-work'], 'default'), + stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']), + stats(__('Angels needed for nightshifts'), $stats['needed-night']), + stats(__('Angels currently working'), $stats['angels-working'], 'default'), + stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'), '