mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
ENHANCEMENT Don't show translations dropdown if all translations have been created.
This commit is contained in:
parent
061057ca04
commit
632192de44
@ -971,11 +971,17 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$createButton->includeDefaultJS(false);
|
$createButton->includeDefaultJS(false);
|
||||||
|
|
||||||
|
if ( count($langDropdown->getSource()) < 1 ) {
|
||||||
|
$fields->insertAfter(new LiteralField('AllTransCreated', _t('Translatable.ALLCREATED', 'All allowed translations have been created.')), 'CreateTransHeader');
|
||||||
|
$fields->removeByName('NewTransLang');
|
||||||
|
$fields->removeByName('createtranslation');
|
||||||
|
}
|
||||||
|
|
||||||
if($alreadyTranslatedLocales) {
|
if($alreadyTranslatedLocales) {
|
||||||
$fields->addFieldToTab(
|
$fields->addFieldToTab(
|
||||||
'Root.Translations',
|
'Root.Translations',
|
||||||
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations:'), 3)
|
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations'), 3)
|
||||||
);
|
);
|
||||||
$existingTransHTML = '<ul>';
|
$existingTransHTML = '<ul>';
|
||||||
foreach($alreadyTranslatedLocales as $langCode) {
|
foreach($alreadyTranslatedLocales as $langCode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user