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
44f8180110
commit
27208655b9
@ -989,11 +989,23 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
)
|
||||
);
|
||||
$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) {
|
||||
$fields->addFieldToTab(
|
||||
'Root.Translations',
|
||||
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations:'), 3)
|
||||
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations'), 3)
|
||||
);
|
||||
$existingTransHTML = '<ul>';
|
||||
foreach($alreadyTranslatedLocales as $langCode) {
|
||||
|
@ -7,9 +7,10 @@ en:
|
||||
LANGAOTHER: 'Other languages'
|
||||
LANGAVAIL: 'Available languages'
|
||||
Translatable:
|
||||
ALLCREATED: 'All allowed translations have been created.'
|
||||
CREATE: 'Create new translation'
|
||||
CREATEBUTTON: Create
|
||||
EXISTING: 'Existing translations:'
|
||||
EXISTING: 'Existing translations'
|
||||
NEWLANGUAGE: 'New language'
|
||||
NOTICENEWPAGE: 'Please save this page before creating a translation'
|
||||
TRANSLATEALLPERMISSION: 'Translate into all available languages'
|
||||
|
Loading…
Reference in New Issue
Block a user