Skip to content

Commit

Permalink
Merge pull request #508 from humhub/enh/77-reduce-translation-message…
Browse files Browse the repository at this point in the history
…-categories

Reduce translation message categories
  • Loading branch information
luke- authored Oct 17, 2024
2 parents ca267ce + 8bd6f30 commit 6b3c054
Show file tree
Hide file tree
Showing 1,097 changed files with 10,401 additions and 14,634 deletions.
4 changes: 2 additions & 2 deletions activities/ResponseAttend.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class ResponseAttend extends BaseActivity implements ConfigurableActivityInterfa
*/
public function getTitle()
{
return Yii::t('CalendarModule.activities', 'Calendar: attend');
return Yii::t('CalendarModule.notification', 'Calendar: attend');
}

/**
* @inheritdoc
*/
public function getDescription()
{
return Yii::t('CalendarModule.activities', 'Whenever someone participates in an event.');
return Yii::t('CalendarModule.notification', 'Whenever someone participates in an event.');
}
}
4 changes: 2 additions & 2 deletions activities/ResponseDeclined.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class ResponseDeclined extends BaseActivity implements ConfigurableActivityInter
*/
public function getTitle()
{
return Yii::t('CalendarModule.activities', 'Calendar: decline');
return Yii::t('CalendarModule.notification', 'Calendar: decline');
}

/**
* @inheritdoc
*/
public function getDescription()
{
return Yii::t('CalendarModule.activities', 'Whenever someone declines to participate in an event.');
return Yii::t('CalendarModule.notification', 'Whenever someone declines to participate in an event.');
}
}
4 changes: 2 additions & 2 deletions activities/ResponseInvited.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class ResponseInvited extends BaseActivity implements ConfigurableActivityInterf
*/
public function getTitle()
{
return Yii::t('CalendarModule.activities', 'Calendar: Invite');
return Yii::t('CalendarModule.notification', 'Calendar: Invite');
}

/**
* @inheritdoc
*/
public function getDescription()
{
return Yii::t('CalendarModule.activities', 'Whenever someone invites to participate in an event.');
return Yii::t('CalendarModule.notification', 'Whenever someone invites to participate in an event.');
}
}
4 changes: 2 additions & 2 deletions activities/ResponseMaybe.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class ResponseMaybe extends BaseActivity implements ConfigurableActivityInterfac
*/
public function getTitle()
{
return Yii::t('CalendarModule.activities', 'Calendar: maybe');
return Yii::t('CalendarModule.notification', 'Calendar: maybe');
}

/**
* @inheritdoc
*/
public function getDescription()
{
return Yii::t('CalendarModule.activities', 'Whenever someone may be participating in an event.');
return Yii::t('CalendarModule.notification', 'Whenever someone may be participating in an event.');
}
}
2 changes: 1 addition & 1 deletion activities/views/response_attend.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$formatter = new CalendarDateFormatter(['calendarItem' => $source]);

echo Yii::t('CalendarModule.views_activities_EntryResponse', '%displayName% is attending %contentTitle%.', [
echo Yii::t('CalendarModule.views', '%displayName% is attending %contentTitle%.', [
'%displayName%' => '<strong>' . Html::encode($originator->displayName) . '</strong>',
'%contentTitle%' => $this->context->getContentInfo($source).' on '.$formatter->getFormattedTime()
]);
Expand Down
2 changes: 1 addition & 1 deletion activities/views/response_declined.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$formatter = new CalendarDateFormatter(['calendarItem' => $source]);

echo Yii::t('CalendarModule.views_activities_EntryResponse', '%displayName% cannot attend %contentTitle%.', [
echo Yii::t('CalendarModule.views', '%displayName% cannot attend %contentTitle%.', [
'%displayName%' => '<strong>' . Html::encode($originator->displayName) . '</strong>',
'%contentTitle%' => $this->context->getContentInfo($source).' on '.$formatter->getFormattedTime()
]);
Expand Down
2 changes: 1 addition & 1 deletion activities/views/response_invited.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$formatter = new CalendarDateFormatter(['calendarItem' => $source]);

echo Yii::t('CalendarModule.views_activities_EntryResponse', '%displayName% is invited to %contentTitle%.', [
echo Yii::t('CalendarModule.views', '%displayName% is invited to %contentTitle%.', [
'%displayName%' => '<strong>' . Html::encode($originator->displayName) . '</strong>',
'%contentTitle%' => $this->context->getContentInfo($source).' on '.$formatter->getFormattedTime()
]);
2 changes: 1 addition & 1 deletion activities/views/response_maybe.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$formatter = new CalendarDateFormatter(['calendarItem' => $source]);

echo Yii::t('CalendarModule.views_activities_EntryResponse', '%displayName% might be attending %contentTitle%.', [
echo Yii::t('CalendarModule.views', '%displayName% might be attending %contentTitle%.', [
'%displayName%' => '<strong>' . Html::encode($originator->displayName) . '</strong>',
'%contentTitle%' => $this->context->getContentInfo($source).' on '.$formatter->getFormattedTime()
]);
Expand Down
10 changes: 5 additions & 5 deletions assets/CalendarAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public static function register($view)
{
$view->registerJsConfig('calendar.Calendar', [
'text' => [
'button.today' => Yii::t('CalendarModule.calendar', 'Today'),
'button.month' => Yii::t('CalendarModule.calendar', 'Month'),
'button.week' => Yii::t('CalendarModule.calendar', 'Week'),
'button.day' => Yii::t('CalendarModule.calendar', 'Day'),
'button.list' => Yii::t('CalendarModule.calendar', 'List'),
'button.today' => Yii::t('CalendarModule.base', 'Today'),
'button.month' => Yii::t('CalendarModule.base', 'Month'),
'button.week' => Yii::t('CalendarModule.base', 'Week'),
'button.day' => Yii::t('CalendarModule.base', 'Day'),
'button.list' => Yii::t('CalendarModule.base', 'List'),
],
]);
return parent::register($view);
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
-----------------------
- Enh #502: Replace theme variables with CSS variables
- Enh #504: Update Active Form for Bootstrap 5
- Enh #508: Reduce translation message categories

1.6.3 (August 23, 2024)
-----------------------
Expand Down
66 changes: 33 additions & 33 deletions interfaces/recurrence/RecurrenceFormModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ public function rules()
public function attributeLabels()
{
return [
'frequency' => Yii::t('CalendarModule.recurrence', 'Repeat every'),
'weekDays' => Yii::t('CalendarModule.recurrence', 'on weekdays'),
'end' => Yii::t('CalendarModule.recurrence', 'End'),
'frequency' => Yii::t('CalendarModule.base', 'Repeat every'),
'weekDays' => Yii::t('CalendarModule.base', 'on weekdays'),
'end' => Yii::t('CalendarModule.base', 'End'),
];
}

Expand All @@ -200,7 +200,7 @@ public function validateModel($attribute, $params)
}

if (!($this->entry instanceof RecurrentEventIF)) {
$this->addError('frequency', Yii::t('CalendarModule.recurrence', 'This event does not support recurrent events'));
$this->addError('frequency', Yii::t('CalendarModule.base', 'This event does not support recurrent events'));
}
}

Expand All @@ -221,13 +221,13 @@ public function validateFrequency($attribute, $params)
try {
$this->setRuleInterval();
} catch (\Exception $e) {
$this->addError('interval', Yii::t('CalendarModule.recurrence', 'Invalid interval given'));
$this->addError('interval', Yii::t('CalendarModule.base', 'Invalid interval given'));
}

try {
$this->setRuleFrequency();
} catch (\Exception $e) {
$this->addError('frequency', Yii::t('CalendarModule.recurrence', 'Invalid frequency given'));
$this->addError('frequency', Yii::t('CalendarModule.base', 'Invalid frequency given'));
}

try {
Expand All @@ -239,9 +239,9 @@ public function validateFrequency($attribute, $params)

} catch (\Exception $e) {
if ($this->interval == Frequency::MONTHLY) {
$this->addError('monthDaySelection', Yii::t('CalendarModule.recurrence', 'Invalid day of month given'));
$this->addError('monthDaySelection', Yii::t('CalendarModule.base', 'Invalid day of month given'));
} elseif ($this->interval == Frequency::WEEKLY) {
$this->addError('weekDays', Yii::t('CalendarModule.recurrence', 'Invalid week day selection'));
$this->addError('weekDays', Yii::t('CalendarModule.base', 'Invalid week day selection'));
}
}
}
Expand Down Expand Up @@ -404,23 +404,23 @@ private function translateDayOfWeekToRrule($dow)
public function getMonthDaySelection()
{
$result = [
self::MONTHLY_BY_DAY_OF_MONTH => Yii::t('CalendarModule.recurrence', 'Monthly on day {dayOfMonth}', [
self::MONTHLY_BY_DAY_OF_MONTH => Yii::t('CalendarModule.base', 'Monthly on day {dayOfMonth}', [
'dayOfMonth' => $this->getStartDayOfMonth(),
]),
];

// If the date is not in the fifth week of the month
if (!$this->isFifthWeekOfMonth($this->getMonthlyPositionOfStart())) {
$result[self::MONTHLY_BY_OCCURRENCE] = Yii::t('CalendarModule.recurrence', 'Monthly on the {position} {dayOfWeek}', [
$result[self::MONTHLY_BY_OCCURRENCE] = Yii::t('CalendarModule.base', 'Monthly on the {position} {dayOfWeek}', [
'position' => $this->getMonthlyPositionOfStartFormatted(),
'dayOfWeek' => $this->getStartDayOfWeekFormatted(),
]);
}

// If the day is in the last week of month we add the possibility for 'last' day of month
if ($this->isLastWeekDayOfMonth()) {
$result[self::MONTHLY_LAST_DAY_OF_MONTH] = Yii::t('CalendarModule.recurrence', 'Monthly on the {position} {dayOfWeek}', [
'position' => Yii::t('CalendarModule.recurrence', 'last'),
$result[self::MONTHLY_LAST_DAY_OF_MONTH] = Yii::t('CalendarModule.base', 'Monthly on the {position} {dayOfWeek}', [
'position' => Yii::t('CalendarModule.base', 'last'),
'dayOfWeek' => $this->getStartDayOfWeekFormatted(),
]);
}
Expand All @@ -437,11 +437,11 @@ private function isLastWeekDayOfMonth()
public function getIntervalTypesSelection()
{
return [
static::FREQUENCY_NEVER => Yii::t('CalendarModule.recurrence', 'Never'),
Frequency::DAILY => Yii::t('CalendarModule.recurrence', 'Day'),
Frequency::WEEKLY => Yii::t('CalendarModule.recurrence', 'Week'),
Frequency::MONTHLY => Yii::t('CalendarModule.recurrence', 'Month'),
Frequency::YEARLY => Yii::t('CalendarModule.recurrence', 'Year'),
static::FREQUENCY_NEVER => Yii::t('CalendarModule.base', 'Never'),
Frequency::DAILY => Yii::t('CalendarModule.base', 'Day'),
Frequency::WEEKLY => Yii::t('CalendarModule.base', 'Week'),
Frequency::MONTHLY => Yii::t('CalendarModule.base', 'Month'),
Frequency::YEARLY => Yii::t('CalendarModule.base', 'Year'),
];

}
Expand All @@ -450,20 +450,20 @@ public function getIntervalTypesSelectionData()
{
return [
Frequency::DAILY => [
'data-singular' => Yii::t('CalendarModule.recurrence', 'Day'),
'data-plural' => Yii::t('CalendarModule.recurrence', 'Days'),
'data-singular' => Yii::t('CalendarModule.base', 'Day'),
'data-plural' => Yii::t('CalendarModule.base', 'Days'),
],
Frequency::WEEKLY => [
'data-singular' => Yii::t('CalendarModule.recurrence', 'Week'),
'data-plural' => Yii::t('CalendarModule.recurrence', 'Weeks'),
'data-singular' => Yii::t('CalendarModule.base', 'Week'),
'data-plural' => Yii::t('CalendarModule.base', 'Weeks'),
],
Frequency::MONTHLY => [
'data-singular' => Yii::t('CalendarModule.recurrence', 'Month'),
'data-plural' => Yii::t('CalendarModule.recurrence', 'Months'),
'data-singular' => Yii::t('CalendarModule.base', 'Month'),
'data-plural' => Yii::t('CalendarModule.base', 'Months'),
],
Frequency::YEARLY => [
'data-singular' => Yii::t('CalendarModule.recurrence', 'Year'),
'data-plural' => Yii::t('CalendarModule.recurrence', 'Years'),
'data-singular' => Yii::t('CalendarModule.base', 'Year'),
'data-plural' => Yii::t('CalendarModule.base', 'Years'),
],
];
}
Expand Down Expand Up @@ -499,24 +499,24 @@ private function getMonthlyPositionOfStartFormatted()
{
switch ($this->getMonthlyPositionOfStart()) {
case 2:
return Yii::t('CalendarModule.recurrence', 'second');
return Yii::t('CalendarModule.base', 'second');
case 3:
return Yii::t('CalendarModule.recurrence', 'third');
return Yii::t('CalendarModule.base', 'third');
case 4:
return Yii::t('CalendarModule.recurrence', 'forth');
return Yii::t('CalendarModule.base', 'forth');
case 5:
return Yii::t('CalendarModule.recurrence', 'last');
return Yii::t('CalendarModule.base', 'last');
default:
return Yii::t('CalendarModule.recurrence', 'first');
return Yii::t('CalendarModule.base', 'first');
}
}

public function getEndTypeSelection()
{
return [
static::ENDS_NEVER => Yii::t('CalendarModule.recurrence', 'Never'),
static::ENDS_ON_DATE => Yii::t('CalendarModule.recurrence', 'On date'),
static::ENDS_AFTER_OCCURRENCES => Yii::t('CalendarModule.recurrence', 'After (occurrences)'),
static::ENDS_NEVER => Yii::t('CalendarModule.base', 'Never'),
static::ENDS_ON_DATE => Yii::t('CalendarModule.base', 'On date'),
static::ENDS_AFTER_OCCURRENCES => Yii::t('CalendarModule.base', 'After (occurrences)'),
];
}

Expand Down
12 changes: 0 additions & 12 deletions messages/am/activities.php

This file was deleted.

Loading

0 comments on commit 6b3c054

Please sign in to comment.