From d18ec187847893f94418b29bc6a087d6b2dd9a2d Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 7 Feb 2025 18:26:05 +0000 Subject: localise note timestamps and stuff --- templates/preferences_form.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'templates/preferences_form.php') diff --git a/templates/preferences_form.php b/templates/preferences_form.php index 8c8f203..33418f6 100644 --- a/templates/preferences_form.php +++ b/templates/preferences_form.php @@ -2,27 +2,26 @@ use Digitigrade\UserSettings; $settings = new UserSettings($user); + +function _user_pref(string $id, mixed $value, string $type) { + call_template('settings_field', [ + 'id' => "pref-$id", + 'fieldName' => $id, + 'name' => __("preferences.$id.name"), + 'description' => __("preferences.$id.description"), + 'value' => $value, + 'type' => $type + ]); +} + ?>
'pref-requestToFollow', - 'fieldName' => 'requestToFollow', - 'name' => __('preferences.requestToFollow.name'), - 'description' => __('preferences.requestToFollow.description'), - 'value' => $user->actor->requestToFollow, - 'type' => 'boolean' - ]); - call_template('settings_field', [ - 'id' => 'pref-smallIndicators', - 'fieldName' => 'smallIndicators', - 'name' => __('preferences.smallIndicators.name'), - 'description' => __('preferences.smallIndicators.description'), - 'value' => $settings->getBool('interface.smallUnreadIndicators'), - 'type' => 'boolean' - ]); + _user_pref('requestToFollow', $user->actor->requestToFollow, 'boolean'); + _user_pref('smallIndicators', $settings->getBool('interface.smallUnreadIndicators'), 'boolean'); + _user_pref('timezone', $settings->get('locale.timezone'), 'timezone'); ?>
-- cgit v1.3