Merged
Conversation
PR Summary
|
Collaborator
Author
|
WordPress core (wp-admin/options-general.php L345-L371) is even more accurate and takes timezone offset into account too: $current_offset = get_option( 'gmt_offset' );
$tzstring = get_option( 'timezone_string' );
$check_zone_info = true;
// Remove old Etc mappings. Fallback to gmt_offset.
if ( str_contains( $tzstring, 'Etc/GMT' ) ) {
$tzstring = '';
}
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
$check_zone_info = false;
if ( 0 === (int) $current_offset ) {
$tzstring = 'UTC+0';
} elseif ( $current_offset < 0 ) {
$tzstring = 'UTC' . $current_offset;
} else {
$tzstring = 'UTC+' . $current_offset;
}
}?>
<th scope="row"><label for="timezone_string"><?php _e( 'Timezone' ); ?></label></th>
<td>
<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">
<?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?>where GatherPress just states: $timezones_raw = explode( PHP_EOL, wp_timezone_choice( 'UTC', get_user_locale() ) );Maybe a chance for later improvement, maybe essentially needed; I don't know. |
Contributor
|
@carstingaxion tested this and works as you described. merging! nice job on this! |
mauteri
approved these changes
Aug 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Closes #746
How to test the Change
BEFORE: Steps to reproduce the problem
A. Plugin not activated: Admin Bar is translated into your users language
B. Plugin activated: Admin Bar is NOT translated, shows in English
AFTER (applying this PR): Steps to see working solution
A. Plugin not activated: Admin Bar is translated into your users language
B. Plugin activated: Admin Bar is (now also) translated into your users language
Changelog Entry
Credits
Props @carstingaxion
Checklist: