From acfe72cb9155ca08bd5799d0dde331702e25e9ce Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 29 Aug 2018 20:25:29 +0200 Subject: [PATCH 1/4] Removed translation from config file --- config/config.default.php | 1 - includes/pages/admin_active.php | 20 +++++++++----------- includes/pages/admin_user.php | 9 +-------- includes/pages/guest_login.php | 8 +------- includes/pages/user_settings.php | 6 ------ includes/sys_form.php | 15 ++++++++++++--- includes/view/User_view.php | 3 ++- 7 files changed, 25 insertions(+), 37 deletions(-) diff --git a/config/config.default.php b/config/config.default.php index 606fa143..0328e500 100644 --- a/config/config.default.php +++ b/config/config.default.php @@ -110,7 +110,6 @@ return [ // Available T-Shirt sizes, set value to null if not available 'tshirt_sizes' => [ - '' => _('Please select...'), 'S' => 'S', 'S-G' => 'S Girl', 'M' => 'M', diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 33a7e01e..35dbe60b 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -244,18 +244,16 @@ function admin_active() $shirt_statistics = []; foreach (array_keys($tshirt_sizes) as $size) { - if (!empty($size)) { - $gc = DB::selectOne( - 'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1', - [$size] - ); - $gc = array_shift($gc); + $gc = DB::selectOne( + 'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1', + [$size] + ); + $gc = array_shift($gc); - $shirt_statistics[] = [ - 'size' => $size, - 'given' => (int)$gc - ]; - } + $shirt_statistics[] = [ + 'size' => $size, + 'given' => (int)$gc + ]; } $shirtCount = User_tshirts_count(); diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 514e4b1b..2841c278 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -18,13 +18,6 @@ function admin_user() global $user, $privileges; $tshirt_sizes = config('tshirt_sizes'); $request = request(); - - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - $html = ''; if (!$request->has('id')) { @@ -68,7 +61,7 @@ function admin_user() } $html .= " jabber" . '' . "\n"; $html .= ' Size' - . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size']) . '' . "\n"; + . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size'], _('Please select...')) . '' . "\n"; $options = [ '1' => _('Yes'), diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 47e16915..d23d9f96 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -69,12 +69,6 @@ function guest_register() } } - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - if (!in_array('register', $privileges) || (!isset($user) && !config('registration_enabled'))) { error(_('Registration is disabled.')); @@ -334,7 +328,7 @@ function guest_register() div('col-sm-6', [ $enable_tshirt_size ? form_select('tshirt_size', _('Shirt size') . ' ' . entry_required(), - $tshirt_sizes, $tshirt_size) : '' + $tshirt_sizes, $tshirt_size, _('Please select...')) : '' ]) ]), div('row', [ diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index b3a5bdf5..930d55d9 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -224,12 +224,6 @@ function user_settings() } } - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - $user_source = $user; if ($request->has('submit')) { diff --git a/includes/sys_form.php b/includes/sys_form.php index 9cb6f38d..b75c7316 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -367,11 +367,16 @@ function form_textarea($name, $label, $value, $disabled = false) * @param string $label * @param string[] $values * @param string $selected + * @param string $selectText * @return string */ -function form_select($name, $label, $values, $selected) +function form_select($name, $label, $values, $selected, $selectText = '') { - return form_element($label, html_select_key('form_' . $name, $name, $values, $selected), 'form_' . $name); + return form_element( + $label, + html_select_key('form_' . $name, $name, $values, $selected, $selectText), + 'form_' . $name + ); } /** @@ -425,11 +430,15 @@ function html_options($name, $options, $selected = '') * @param string $name * @param string[] $rows * @param string $selected + * @param string $selectText * @return string */ -function html_select_key($dom_id, $name, $rows, $selected) +function html_select_key($dom_id, $name, $rows, $selected, $selectText = '') { $html = '' . "\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'), '