mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Merge pull request #121 from jthomerson/pulls/cms_fields_performance_improvement
ENHANCEMENT: significant speed improvement for many locales
This commit is contained in:
commit
8518d1cf20
@ -1010,12 +1010,11 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
));
|
||||
if(!$tab->fieldByName('existingtrans')) {
|
||||
$existingTransHTML = '<ul>';
|
||||
foreach($alreadyTranslatedLocales as $langCode) {
|
||||
$existingTranslation = $this->owner->getTranslation($langCode);
|
||||
foreach($this->getTranslations() as $existingTranslation) {
|
||||
if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
|
||||
$existingTransHTML .= sprintf('<li><a href="%s">%s</a></li>',
|
||||
sprintf('%s/?locale=%s', $existingTranslation->CMSEditLink(), $langCode),
|
||||
i18n::get_locale_name($langCode)
|
||||
sprintf('%s/?locale=%s', $existingTranslation->CMSEditLink(), $existingTranslation->Locale),
|
||||
i18n::get_locale_name($existingTranslation->Locale)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user