Skip to content

Commit

Permalink
Merge pull request #824 from davejtoews/bugfix-textcollector-warnings
Browse files Browse the repository at this point in the history
FIX allows i18nTextCollector to concatenate keys
  • Loading branch information
tractorcow authored Feb 13, 2024
2 parents ba53c83 + 2a8e81e commit 42ecdc3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions src/Extension/Traits/FluentAdminTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function updateFluentActions(
// Add menu button
$moreOptions = Tab::create(
'FluentMenuOptions',
_t(__TRAIT__ . '.Localisation', 'Localisation')
_t('TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Localisation', 'Localisation')
);
$moreOptions->addExtraClass('popover-actions-simulate');
$rootTabSet->push($moreOptions);
Expand All @@ -117,7 +117,7 @@ protected function updateFluentActions(
FormAction::create(
'clearFluent',
_t(
__TRAIT__ . '.Label_clearFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_clearFluent',
"Clear from all except '{title}'",
[
'title' => $locale->getTitle()
Expand All @@ -129,7 +129,7 @@ protected function updateFluentActions(
FormAction::create(
'copyFluent',
_t(
__TRAIT__ . '.Label_copyFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_copyFluent',
"Copy '{title}' to other locales",
[
'title' => $locale->getTitle()
Expand All @@ -144,7 +144,7 @@ protected function updateFluentActions(
FormAction::create(
'unpublishFluent',
_t(
__TRAIT__ . '.Label_unpublishFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_unpublishFluent',
'Unpublish (all locales)'
)
)->addExtraClass('btn-secondary')
Expand All @@ -153,7 +153,7 @@ protected function updateFluentActions(
FormAction::create(
'archiveFluent',
_t(
__TRAIT__ . '.Label_archiveFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_archiveFluent',
'Unpublish and Archive (all locales)'
)
)->addExtraClass('btn-outline-danger')
Expand All @@ -162,7 +162,7 @@ protected function updateFluentActions(
FormAction::create(
'publishFluent',
_t(
__TRAIT__ . '.Label_publishFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_publishFluent',
'Save & Publish (all locales)'
)
)->addExtraClass('btn-primary')
Expand All @@ -172,7 +172,7 @@ protected function updateFluentActions(
FormAction::create(
'deleteFluent',
_t(
__TRAIT__ . '.Label_deleteFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_deleteFluent',
'Delete (all locales)'
)
)->addExtraClass('btn-outline-danger')
Expand All @@ -187,7 +187,7 @@ protected function updateFluentActions(
FormAction::create(
'hideFluent',
_t(
__TRAIT__ . '.Label_hideFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_hideFluent',
"Hide from '{title}'",
[
'title' => $locale->getTitle()
Expand All @@ -200,7 +200,7 @@ protected function updateFluentActions(
FormAction::create(
'showFluent',
_t(
__TRAIT__ . '.Label_showFluent',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.Label_showFluent',
"Show in '{title}'",
[
'title' => $locale->getTitle()
Expand Down Expand Up @@ -256,7 +256,7 @@ public function clearFluent($data, $form)
});

$message = _t(
__TRAIT__ . '.ClearAllNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.ClearAllNotice',
"All localisations have been cleared for '{title}'.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -292,7 +292,7 @@ public function copyFluent($data, $form)
if ($locale->ID == $originalLocale->ID) {
return;
}

if ($record->hasExtension(Versioned::class)) {
$record->writeToStage(Versioned::DRAFT);
} else {
Expand All @@ -302,7 +302,7 @@ public function copyFluent($data, $form)
});

$message = _t(
__TRAIT__ . '.CopyNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.CopyNotice',
"Copied '{title}' to all other locales.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -336,7 +336,7 @@ public function unpublishFluent($data, $form)
});

$message = _t(
__TRAIT__ . '.UnpublishNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.UnpublishNotice',
"Unpublished '{title}' from all locales.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -386,7 +386,7 @@ public function archiveFluent($data, $form)
$policy->delete($record);

$message = _t(
__TRAIT__ . '.ArchiveNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.ArchiveNotice',
"Archived '{title}' and all of its localisations.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -434,7 +434,7 @@ public function deleteFluent($data, $form)
$policy->delete($record);

$message = _t(
__TRAIT__ . '.DeleteNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.DeleteNotice',
"Deleted '{title}' and all of its localisations.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -478,7 +478,7 @@ public function publishFluent($data, $form)
});

$message = _t(
__TRAIT__ . '.PublishNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.PublishNotice',
"Published '{title}' across all locales.",
['title' => $record->Title]
);
Expand Down Expand Up @@ -508,7 +508,7 @@ public function showFluent($data, $form)
$record->FilteredLocales()->add($locale);

$message = _t(
__TRAIT__ . '.ShowNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.ShowNotice',
"Record '{title}' is now visible in {locale}",
[
'title' => $record->Title,
Expand Down Expand Up @@ -541,7 +541,7 @@ public function hideFluent($data, $form)
$record->FilteredLocales()->remove($locale);

$message = _t(
__TRAIT__ . '.HideNotice',
'TractorCow\Fluent\Extension\Traits\FluentAdminTrait.HideNotice',
"Record '{title}' is now hidden in {locale}",
[
'title' => $record->Title,
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/Traits/FluentBadgeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function generateBadgeHTML(
// If the object has been localised in the current locale, show a "localised" state
$badgeClasses[] = 'fluent-badge--default';
$tooltip = _t(
__TRAIT__ . '.BadgeLocalised',
'TractorCow\Fluent\Extension\Traits\FluentBadgeTrait.BadgeLocalised',
'Localised in {locale}',
[
'locale' => $locale->getTitle()
Expand All @@ -86,7 +86,7 @@ protected function generateBadgeHTML(
// If object is inheriting content from another locale show the source
$badgeClasses[] = 'fluent-badge--localised';
$tooltip = _t(
__TRAIT__ . '.BadgeInherited',
'TractorCow\Fluent\Extension\Traits\FluentBadgeTrait.BadgeInherited',
'Inherited from {locale}',
[
'locale' => $info->getSourceLocale()->getTitle()
Expand All @@ -97,7 +97,7 @@ protected function generateBadgeHTML(
// by either localising or seting up a locale fallback
$badgeClasses[] = 'fluent-badge--invisible';
$tooltip = _t(
__TRAIT__ . '.BaggeInvisible',
'TractorCow\Fluent\Extension\Traits\FluentBadgeTrait.BaggeInvisible',
'{type} has no available content in {locale}, localise the {type} or provide a locale fallback',
[
'type' => $record->i18n_singular_name(),
Expand Down
2 changes: 1 addition & 1 deletion src/Extension/Traits/FluentObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function updateFluentCMSFields(FieldList $fields)

$fields
->fieldByName('Root.Locales')
->setTitle(_t(__TRAIT__ . '.TAB_LOCALISATION', 'Localisation'));
->setTitle(_t('TractorCow\Fluent\Extension\Traits\FluentObjectTrait.TAB_LOCALISATION', 'Localisation'));
} else {
$fields->push($gridField);
}
Expand Down

0 comments on commit 42ecdc3

Please sign in to comment.