ENHANCEMENT Don't show translations dropdown if all translations have been created.

This commit is contained in:
Simon Elvery 2013-01-04 09:22:46 +10:00 committed by Ingo Schommer
parent 44f8180110
commit 27208655b9
2 changed files with 15 additions and 2 deletions

View File

@ -989,11 +989,23 @@ 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) {

View File

@ -7,9 +7,10 @@ en:
LANGAOTHER: 'Other languages' LANGAOTHER: 'Other languages'
LANGAVAIL: 'Available languages' LANGAVAIL: 'Available languages'
Translatable: Translatable:
ALLCREATED: 'All allowed translations have been created.'
CREATE: 'Create new translation' CREATE: 'Create new translation'
CREATEBUTTON: Create CREATEBUTTON: Create
EXISTING: 'Existing translations:' EXISTING: 'Existing translations'
NEWLANGUAGE: 'New language' NEWLANGUAGE: 'New language'
NOTICENEWPAGE: 'Please save this page before creating a translation' NOTICENEWPAGE: 'Please save this page before creating a translation'
TRANSLATEALLPERMISSION: 'Translate into all available languages' TRANSLATEALLPERMISSION: 'Translate into all available languages'