Index: /sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/class-plugin.php
===================================================================
--- /sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/class-plugin.php (revision 4032)
+++ /sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/class-plugin.php (revision 4033)
@@ -61,4 +61,77 @@
// Customizations for all sites.
+ $this->filter_date_options();
+ }
+
+ /**
+ * Adds filters for all date options.
+ */
+ private function filter_date_options() {
+ $options = new Filter\Options();
+
+ $options->add_option(
+ ( new Filter\Option() )
+ ->set_name( 'timezone_string' )
+ ->set_callback( function() {
+ /* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
+ * or a valid timezone string (America/New_York). See https://secure.php.net/manual/timezones.php
+ * for all timezone strings supported by PHP.
+ */
+ $offset_or_tz = _x( '0', 'default GMT offset or timezone string', 'rosetta' );
+ if ( $offset_or_tz && ! is_numeric( $offset_or_tz ) && in_array( $offset_or_tz, timezone_identifiers_list() ) ) {
+ return $offset_or_tz;
+ } else {
+ return '';
+ }
+ } )
+ ->set_priority( 9 ) // Before `wp_timezone_override_offset()`
+ );
+
+ $options->add_option(
+ ( new Filter\Option() )
+ ->set_name( 'gmt_offset' )
+ ->set_callback( function() {
+ /* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
+ * or a valid timezone string (America/New_York). See https://secure.php.net/manual/timezones.php
+ * for all timezone strings supported by PHP.
+ */
+ $offset_or_tz = _x( '0', 'default GMT offset or timezone string', 'rosetta' );
+ if ( $offset_or_tz && is_numeric( $offset_or_tz ) ) {
+ return $offset_or_tz;
+ } else {
+ return 0;
+ }
+ } )
+ ->set_priority( 9 ) // Before `wp_timezone_override_offset()`
+ );
+
+ $options->add_option(
+ ( new Filter\Option() )
+ ->set_name( 'date_format' )
+ ->set_callback( function() {
+ /* translators: default date format, see https://secure.php.net/date */
+ return __( 'F j, Y', 'rosetta' );
+ } )
+ );
+
+ $options->add_option(
+ ( new Filter\Option() )
+ ->set_name( 'time_format' )
+ ->set_callback( function() {
+ /* translators: default time format, see https://secure.php.net/date */
+ return __( 'g:i a', 'rosetta' );
+ } )
+ );
+
+ $options->add_option(
+ ( new Filter\Option() )
+ ->set_name( 'start_of_week' )
+ ->set_callback( function() {
+ /* translators: default start of the week. 0 = Sunday, 1 = Monday */
+ return _x( '1', 'start of week', 'rosetta' );
+ } )
+ );
+
+ $options->setup();
}
}