mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
I18N: Add new WP_Locale::get_month_genitive()
method.
Complements existing helper methods such as `WP_Locale::get_month_abbrev()`. Props ankitkumarshah, Tkama, SergeyBiryukov. Fixes #58658. Built from https://develop.svn.wordpress.org/trunk@59494 git-svn-id: http://core.svn.wordpress.org/trunk@58880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c24a5b9062
commit
03a5e578d8
@ -336,6 +336,26 @@ class WP_Locale {
|
|||||||
return $this->month_abbrev[ $month_name ];
|
return $this->month_abbrev[ $month_name ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves translated version of month genitive string.
|
||||||
|
*
|
||||||
|
* The $month_number parameter has to be a string
|
||||||
|
* because it must have the '0' in front of any number
|
||||||
|
* that is less than 10. Starts from '01' and ends at
|
||||||
|
* '12'.
|
||||||
|
*
|
||||||
|
* You can use an integer instead and it will add the
|
||||||
|
* '0' before the numbers less than 10 for you.
|
||||||
|
*
|
||||||
|
* @since 6.8.0
|
||||||
|
*
|
||||||
|
* @param string|int $month_number '01' through '12'.
|
||||||
|
* @return string Translated genitive month name.
|
||||||
|
*/
|
||||||
|
public function get_month_genitive( $month_number ) {
|
||||||
|
return $this->month_genitive[ zeroise( $month_number, 2 ) ];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves translated version of meridiem string.
|
* Retrieves translated version of meridiem string.
|
||||||
*
|
*
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.8-alpha-59493';
|
$wp_version = '6.8-alpha-59494';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user