mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT #5352 Translatable entities for help text in Member_DatetimeOptionsetField::getFormattingHelpText() (from r107334)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112569 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
47762cdf5b
commit
6959909cb6
@ -1886,23 +1886,24 @@ class Member_DatetimeOptionsetField extends OptionsetField {
|
|||||||
* @todo Put this text into a template?
|
* @todo Put this text into a template?
|
||||||
*/
|
*/
|
||||||
function getFormattingHelpText() {
|
function getFormattingHelpText() {
|
||||||
return '<ul>
|
$output = '<ul>';
|
||||||
<li>YYYY = four-digit year</li>
|
$output .= '<li>YYYY = ' . _t('MemberDatetimeOptionsetField.FOURDIGITYEAR', 'Four-digit year', 40, 'Help text describing what "YYYY" means in ISO date formatting') . '</li>';
|
||||||
<li>YY = two-digit year</li>
|
$output .= '<li>YY = ' . _t('MemberDatetimeOptionsetField.TWODIGITYEAR', 'Two-digit year', 40, 'Help text describing what "YY" means in ISO date formatting') . '</li>';
|
||||||
<li>MMMM = full name of month (e.g. June)</li>
|
$output .= '<li>MMMM = ' . _t('MemberDatetimeOptionsetField.FULLNAMEMONTH', 'Full name of month (e.g. June)', 40, 'Help text describing what "MMMM" means in ISO date formatting') . '</li>';
|
||||||
<li>MMM = shortened name of month (e.g. Jun)</li>
|
$output .= '<li>MMM = ' . _t('MemberDatetimeOptionsetField.SHORTMONTH', 'Short name of month (e.g. Jun)', 40, 'Help text letting describing what "MMM" means in ISO date formatting') . '</li>';
|
||||||
<li>MM = two-digit month (01=January, etc.)</li>
|
$output .= '<li>MM = ' . _t('MemberDatetimeOptionsetField.TWODIGITMONTH', 'Two-digit month (01=January, etc.)', 40, 'Help text describing what "MM" means in ISO date formatting') . '</li>';
|
||||||
<li>M = day of month without leading zero</li>
|
$output .= '<li>M = ' . _t('MemberDatetimeOptionsetField.MONTHNOLEADING', 'Month digit without leading zero', 40, 'Help text describing what "M" means in ISO date formatting') . '</li>';
|
||||||
<li>dd = two-digit day of month (01 through 31)</li>
|
$output .= '<li>dd = ' . _t('MemberDatetimeOptionsetField.TWODIGITDAY', 'Two-digit day of month', 40, 'Help text describing what "dd" means in ISO date formatting') . '</li>';
|
||||||
<li>d = day of month without leading zero</li>
|
$output .= '<li>d = ' . _t('MemberDatetimeOptionsetField.DAYNOLEADING', 'Day of month without leading zero', 40, 'Help text describing what "d" means in ISO date formatting') . '</li>';
|
||||||
<li>hh = two digits of hour (00 through 23)</li>
|
$output .= '<li>hh = ' . _t('MemberDatetimeOptionsetField.TWODIGITHOUR', 'Two digits of hour (00 through 23)', 40, 'Help text describing what "hh" means in ISO date formatting') . '</li>';
|
||||||
<li>h = hour without leading zero</li>
|
$output .= '<li>h = ' . _t('MemberDatetimeOptionsetField.HOURNOLEADING', 'Hour without leading zero', 40, 'Help text describing what "h" means in ISO date formatting') . '</li>';
|
||||||
<li>mm = two digits of minute (00 through 59)</li>
|
$output .= '<li>mm = ' . _t('MemberDatetimeOptionsetField.TWODIGITMINUTE', 'Two digits of minute (00 through 59)', 40, 'Help text describing what "mm" means in ISO date formatting') . '</li>';
|
||||||
<li>m = minute without leading zero</li>
|
$output .= '<li>m = ' . _t('MemberDatetimeOptionsetField.MINUTENOLEADING', 'Minute without leading zero', 40, 'Help text describing what "m" means in ISO date formatting') . '</li>';
|
||||||
<li>ss = two digits of second (00 through 59)</li>
|
$output .= '<li>ss = ' . _t('MemberDatetimeOptionsetField.TWODIGITSECOND', 'Two digits of second (00 through 59)', 40, 'Help text describing what "ss" means in ISO date formatting') . '</li>';
|
||||||
<li>s = one or more digits representing a decimal fraction of a second</li>
|
$output .= '<li>s = ' . _t('MemberDatetimeOptionsetField.DIGITSDECFRACTIONSECOND', 'One or more digits representing a decimal fraction of a second', 40, 'Help text describing what "s" means in ISO date formatting') . '</li>';
|
||||||
<li>a = AM or PM</li>
|
$output .= '<li>a = ' . _t('MemberDatetimeOptionsetField.AMORPM', 'AM (Ante meridiem) or PM (Post meridiem)', 40, 'Help text describing what "a" means in ISO date formatting') . '</li>';
|
||||||
</ul>';
|
$output .= '</ul>';
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setValue($value) {
|
function setValue($value) {
|
||||||
@ -1927,7 +1928,7 @@ class Member_DatetimeOptionsetField extends OptionsetField {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if($validator) {
|
if($validator) {
|
||||||
$validator->validationError($this->name, _t('Member.DATEFORMATBAD',"Date format is invalid"), "validation", false);
|
$validator->validationError($this->name, _t('MemberDatetimeOptionsetField.DATEFORMATBAD',"Date format is invalid"), "validation", false);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user