wp/wp-includes/locale.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
    15 	/**
    15 	/**
    16 	 * Stores the translated strings for the full weekday names.
    16 	 * Stores the translated strings for the full weekday names.
    17 	 *
    17 	 *
    18 	 * @since 2.1.0
    18 	 * @since 2.1.0
    19 	 * @var array
    19 	 * @var array
    20 	 * @access private
    20 	 */
    21 	 */
    21 	public $weekday;
    22 	var $weekday;
       
    23 
    22 
    24 	/**
    23 	/**
    25 	 * Stores the translated strings for the one character weekday names.
    24 	 * Stores the translated strings for the one character weekday names.
    26 	 *
    25 	 *
    27 	 * There is a hack to make sure that Tuesday and Thursday, as well
    26 	 * There is a hack to make sure that Tuesday and Thursday, as well
    29 	 *
    28 	 *
    30 	 * @see WP_Locale::init() for how to handle the hack.
    29 	 * @see WP_Locale::init() for how to handle the hack.
    31 	 *
    30 	 *
    32 	 * @since 2.1.0
    31 	 * @since 2.1.0
    33 	 * @var array
    32 	 * @var array
    34 	 * @access private
    33 	 */
    35 	 */
    34 	public $weekday_initial;
    36 	var $weekday_initial;
       
    37 
    35 
    38 	/**
    36 	/**
    39 	 * Stores the translated strings for the abbreviated weekday names.
    37 	 * Stores the translated strings for the abbreviated weekday names.
    40 	 *
    38 	 *
    41 	 * @since 2.1.0
    39 	 * @since 2.1.0
    42 	 * @var array
    40 	 * @var array
    43 	 * @access private
    41 	 */
    44 	 */
    42 	public $weekday_abbrev;
    45 	var $weekday_abbrev;
       
    46 
    43 
    47 	/**
    44 	/**
    48 	 * Stores the translated strings for the full month names.
    45 	 * Stores the translated strings for the full month names.
    49 	 *
    46 	 *
    50 	 * @since 2.1.0
    47 	 * @since 2.1.0
    51 	 * @var array
    48 	 * @var array
    52 	 * @access private
    49 	 */
    53 	 */
    50 	public $month;
    54 	var $month;
       
    55 
    51 
    56 	/**
    52 	/**
    57 	 * Stores the translated strings for the abbreviated month names.
    53 	 * Stores the translated strings for the abbreviated month names.
    58 	 *
    54 	 *
    59 	 * @since 2.1.0
    55 	 * @since 2.1.0
    60 	 * @var array
    56 	 * @var array
    61 	 * @access private
    57 	 */
    62 	 */
    58 	public $month_abbrev;
    63 	var $month_abbrev;
       
    64 
    59 
    65 	/**
    60 	/**
    66 	 * Stores the translated strings for 'am' and 'pm'.
    61 	 * Stores the translated strings for 'am' and 'pm'.
    67 	 *
    62 	 *
    68 	 * Also the capitalized versions.
    63 	 * Also the capitalized versions.
    69 	 *
    64 	 *
    70 	 * @since 2.1.0
    65 	 * @since 2.1.0
    71 	 * @var array
    66 	 * @var array
    72 	 * @access private
    67 	 */
    73 	 */
    68 	public $meridiem;
    74 	var $meridiem;
       
    75 
    69 
    76 	/**
    70 	/**
    77 	 * The text direction of the locale language.
    71 	 * The text direction of the locale language.
    78 	 *
    72 	 *
    79 	 * Default is left to right 'ltr'.
    73 	 * Default is left to right 'ltr'.
    80 	 *
    74 	 *
    81 	 * @since 2.1.0
    75 	 * @since 2.1.0
    82 	 * @var string
    76 	 * @var string
    83 	 * @access private
    77 	 */
    84 	 */
    78 	public $text_direction = 'ltr';
    85 	var $text_direction = 'ltr';
    79 
       
    80 	/**
       
    81 	 * @var array
       
    82 	 */
       
    83 	public $number_format;
    86 
    84 
    87 	/**
    85 	/**
    88 	 * Sets up the translated strings and object properties.
    86 	 * Sets up the translated strings and object properties.
    89 	 *
    87 	 *
    90 	 * The method creates the translatable strings for various
    88 	 * The method creates the translatable strings for various
   181 		if ( isset( $GLOBALS['text_direction'] ) )
   179 		if ( isset( $GLOBALS['text_direction'] ) )
   182 			$this->text_direction = $GLOBALS['text_direction'];
   180 			$this->text_direction = $GLOBALS['text_direction'];
   183 		/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
   181 		/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
   184 		elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
   182 		elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
   185 			$this->text_direction = 'rtl';
   183 			$this->text_direction = 'rtl';
       
   184 
       
   185 		if ( 'rtl' === $this->text_direction && strpos( $GLOBALS['wp_version'], '-src' ) ) {
       
   186 			$this->text_direction = 'ltr';
       
   187 			add_action( 'all_admin_notices', array( $this, 'rtl_src_admin_notice' ) );
       
   188 		}
       
   189 	}
       
   190 
       
   191 	function rtl_src_admin_notice() {
       
   192 		echo '<div class="error"><p>' . 'The <code>build</code> directory of the develop repository must be used for RTL.' . '</p></div>';
   186 	}
   193 	}
   187 
   194 
   188 	/**
   195 	/**
   189 	 * Retrieve the full translated weekday word.
   196 	 * Retrieve the full translated weekday word.
   190 	 *
   197 	 *
   309 	 *
   316 	 *
   310 	 * @uses WP_Locale::init()
   317 	 * @uses WP_Locale::init()
   311 	 * @uses WP_Locale::register_globals()
   318 	 * @uses WP_Locale::register_globals()
   312 	 * @since 2.1.0
   319 	 * @since 2.1.0
   313 	 *
   320 	 *
   314 	 * @return WP_Locale
       
   315 	 */
   321 	 */
   316 	function __construct() {
   322 	function __construct() {
   317 		$this->init();
   323 		$this->init();
   318 		$this->register_globals();
   324 		$this->register_globals();
   319 	}
   325 	}
   327 	function is_rtl() {
   333 	function is_rtl() {
   328 		return 'rtl' == $this->text_direction;
   334 		return 'rtl' == $this->text_direction;
   329 	}
   335 	}
   330 
   336 
   331 	/**
   337 	/**
   332 	 * Private, unused function to add some date/time formats translated
   338 	 * Register date/time format strings for general POT.
   333 	 * on wp-admin/options-general.php to the general POT.
   339 	 *
       
   340 	 * Private, unused method to add some date/time formats translated
       
   341 	 * on wp-admin/options-general.php to the general POT that would
       
   342 	 * otherwise be added to the admin POT.
   334 	 *
   343 	 *
   335 	 * @since 3.6.0
   344 	 * @since 3.6.0
   336 	 */
   345 	 */
   337 	function _strings_for_pot() {
   346 	function _strings_for_pot() {
   338 		/* translators: localized date format, see http://php.net/date */
   347 		/* translators: localized date format, see http://php.net/date */