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

@ -990,10 +990,22 @@ 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) {

View File

@ -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'