1
0
mirror of https://github.com/rlanvin/php-rrule.git synced 2024-11-28 05:24:10 +01:00

Add Hebrew translation

i18n add he, remove automatic space after "and"

add shortened weekdays names for lists
This commit is contained in:
roikedem 2021-04-12 11:59:55 +03:00 committed by rlanvin
parent a6c8896894
commit d118a932fc
9 changed files with 208 additions and 14 deletions

View File

@ -1934,7 +1934,7 @@ class RRule implements RRuleInterface
if (count($array) > 1) {
$last = array_splice($array, -1);
return sprintf(
'%s %s %s',
'%s %s%s',
implode(', ',$array),
$and,
implode('',$last)
@ -2253,11 +2253,19 @@ class RRule implements RRuleInterface
$parts['byweekday'] = array();
if ($this->byweekday) {
$tmp = $this->byweekday;
$shorten_weekdays_in_list = !empty($i18n['shorten_weekdays_in_list']) && count($tmp) > 1;
if ($shorten_weekdays_in_list) {
$daysnames = $i18n['weekdays_shortened_for_list'];
}
else {
$daysnames = $i18n['weekdays'];
}
foreach ($tmp as & $value) {
$value = $i18n['weekdays'][$value];
$value = $daysnames[$value];
}
$prefix = $shorten_weekdays_in_list ? $i18n['shorten_weekdays_days'] : "";
$parts['byweekday'][] = strtr(self::i18nSelect($i18n['byweekday'], count($tmp)), array(
'%{weekdays}' => self::i18nList($tmp, $i18n['and'])
'%{weekdays}' => $prefix . self::i18nList($tmp, $i18n['and'])
));
}
if ($this->byweekday_nth) {

View File

@ -50,7 +50,7 @@ return array(
'1' => ', einmalig',
'else' => ', %{count} Mal insgesamt'
),
'and' => 'und',
'and' => 'und ',
'x_of_the_y' => array(
'yearly' => '%{x} des Jahres', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} des Monats',
@ -147,4 +147,4 @@ return array(
'-2' => 'die vorletzte',
'else' => 'die %{n}. letzte'
)
);
);

View File

@ -52,7 +52,7 @@ return array(
'1' => ', one time',
'else' => ', %{count} times'
),
'and' => 'and',
'and' => 'and ',
'x_of_the_y' => array(
'yearly' => '%{x} of the year', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} of the month',
@ -164,4 +164,4 @@ return array(
'-3' => 'the antepenultimate',
'else' => 'the %{n}th to the last'
)
);
);

View File

@ -45,7 +45,7 @@ return array(
'1' => ', una vez',
'else' => ', %{count} veces'
),
'and' => 'y',
'and' => 'y ',
'x_of_the_y' => array(
'yearly' => '%{x} del año', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} del mes',

View File

@ -52,7 +52,7 @@ return array(
'1' => ', kerran',
'else' => ', %{count} kertaa'
),
'and' => 'ja',
'and' => 'ja ',
'x_of_the_y' => array(
'yearly' => '%{x} vuodessa', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} kuukaudessa',
@ -133,4 +133,4 @@ return array(
'-1' => 'viimeinen',
'else' => '%{n}:ksi viimeinen'
)
);
);

View File

@ -50,7 +50,7 @@ return array(
'1' => ', une fois',
'else' => ', %{count} fois'
),
'and' => 'et',
'and' => 'et ',
'x_of_the_y' => array(
'yearly' => '%{x} de l\'année', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} du mois',
@ -152,4 +152,4 @@ return array(
'-3' => 'l\'antépénultième',
'else' => 'la %{n}e en partant de la fin'
)
);
);

186
src/i18n/he.php Normal file
View File

@ -0,0 +1,186 @@
<?php
/**
* Translation file for English language.
*
* Most strings can be an array, with a value as the key. The system will
* pick the translation corresponding to the key. The key "else" will be picked
* if no matching value is found. This is useful for plurals.
*
* Licensed under the MIT license.
*
* For the full copyright and license information, please view the LICENSE file.
*
* @author Rémi Lanvin <remi@cloudconnected.fr>
* @link https://github.com/rlanvin/php-rrule
*/
return array(
'yearly' => array(
'1' => 'כל שנה',
'else' => 'כל %{interval} שנים'
),
'monthly' => array(
'1' => 'monthly',
'else' => 'every %{interval} months'
),
'weekly' => array(
'1' => 'כל שבוע',
'2' => 'פעם בשבועיים',
'else' => 'כל %{interval} שבועות'
),
'daily' => array(
'1' => 'כל יום',
'2' => 'פעם ביומיים',
'else' => 'כל %{interval} ימים'
),
'hourly' => array(
'1' => 'כל שעה',
'else' => 'כל %{interval} שעות'
),
'minutely' => array(
'1' => 'כל דקה',
'else' => 'כל %{interval} דקות'
),
'secondly' => array(
'1' => 'כל שניה',
'else' => 'כל %{interval} שניות'
),
'dtstart' => ', החל מ%{date}',
'infinite' => ', לעד',
'until' => ', עד %{date}',
'count' => array(
'1' => ', פעם אחת',
'else' => ', %{count} פעמים'
),
'and' => 'ו',
'x_of_the_y' => array(
'yearly' => '%{x} בשנה', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} בחודש',
),
'bymonth' => ' ב%{months}',
'months' => array(
1 => 'ינואר',
2 => 'פברואר',
3 => 'מארס',
4 => 'אפריל',
5 => 'מאי',
6 => 'יוני',
7 => 'יולי',
8 => 'אוגוסט',
9 => 'ספטמבר',
10 => 'אוקטובר',
11 => 'נובמבר',
12 => 'דצמבר',
),
'byweekday' => ' ב%{weekdays}',
'weekdays' => array(
1 => "יום ב'",
2 => "יום ג'",
3 => "יום ד'",
4 => "יום ה'",
5 => "יום ו'",
6 => "שבת",
7 => "יום א'",
),
'shorten_weekdays_in_list' => true,
'shorten_weekdays_days' => 'ימים ',
'weekdays_shortened_for_list' => array(
1 => "שני",
2 => "שלישי",
3 => "רביעי",
4 => "חמישי",
5 => "שישי",
6 => "שבת",
7 => "ראשון",
),
'nth_weekday' => array(
'1' => '%{weekday} הראשון', // e.g. the first Monday
'2' => '%{weekday} השני',
'3' => '%{weekday} השלישי',
'4' => '%{weekday} הרביעי',
'5' => '%{weekday} החמישי',
'6' => '%{weekday} השישי',
'7' => '%{weekday} השביעי',
'8' => '%{weekday} השמיני',
'9' => '%{weekday} התשיעי',
'10' => '%{weekday} העשירי',
'else' => '%{weekday} ה-%{n}'
),
'-nth_weekday' => array(
'-1' => '%{weekday} האחרון', // e.g. the last Monday
'-2' => '%{weekday} לפני האחרון',
'else' => '%{weekday} ה-%{n} לפני האחרון'
),
'byweekno' => array(
'1' => ' בשבוע %{weeks}',
'else' => ' בשבוע מספר %{weeks}'
),
'nth_weekno' => '%{n}',
'bymonthday' => ' ב%{monthdays}',
'nth_monthday' => array(
'else' => 'ה-%{n}'
),
'-nth_monthday' => array(
'-1' => 'היום האחרון',
'-2' => 'היום הלפני-אחרון',
'else' => 'היום ה-%{n} מהסוף'
),
'byyearday' => array(
'1' => ' ביום%{yeardays}',
'else' => ' בימים %{yeardays}'
),
'nth_yearday' => array(
'1' => 'הראשון',
'2' => 'השני',
'3' => 'השלישי',
'4' => 'הרביעי',
'5' => 'החמישי',
'6' => 'השישי',
'7' => 'השביעי',
'8' => 'השמיני',
'9' => 'התשיעי',
'10' => 'העשירי',
'else' => 'ה-%{n}'
),
'-nth_yearday' => array(
'-1' => 'האחרון',
'-2' => 'לפני האחרון',
'-3' => 'שניים לפני האחרון',
'else' => 'ה %{n} מהסוף'
),
'byhour' => array(
'1' => ' ב%{hours}',
'else' => ' ב%{hours}'
),
'nth_hour' => '%{n}',
'byminute' => array(
'1' => ' בדקה %{minutes}',
'else' => ' בדקות %{minutes}'
),
'nth_minute' => '%{n}',
'bysecond' => array(
'1' => ' בשניה %{seconds}',
'else' => ' בשניות %{seconds}'
),
'nth_second' => '%{n}',
'bysetpos' => ', אבל רק %{setpos} פעמים בסדרה זו',
'nth_setpos' => array(
'1' => 'הראשון',
'2' => 'השני',
'3' => 'השלישי',
'4' => 'הרביעי',
'5' => 'החמישי',
'6' => 'השישי',
'7' => 'השביעי',
'8' => 'השמיני',
'9' => 'התשיעי',
'10' => 'העשירי',
'else' => 'ה-%{n}'
),
'-nth_setpos' => array(
'-1' => 'האחרון',
'-2' => 'לפני האחרון',
'-3' => 'שניים לפני האחרון',
'else' => 'ה %{n} מהסוף'
)
);

View File

@ -44,7 +44,7 @@ return array(
'1' => ', una volta',
'else' => ', %{count} volte'
),
'and' => 'e',
'and' => 'e ',
'x_of_the_y' => array(
'yearly' => '%{x} dell\'anno', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} del mese',

View File

@ -52,7 +52,7 @@ return array(
'1' => ', één keer',
'else' => ', %{count} keren'
),
'and' => 'en',
'and' => 'en ',
'x_of_the_y' => array(
'yearly' => '%{x} van het jaar', // e.g. the first Monday of the year, or the first day of the year
'monthly' => '%{x} van de maand',