diff --git a/traits/MLControl.php b/traits/MLControl.php index ba3087f..31eba3a 100644 --- a/traits/MLControl.php +++ b/traits/MLControl.php @@ -188,14 +188,14 @@ protected function makeRenderFormField() public function getLocaleFieldName($code) { - if ($this->isLongFormNeeded()) { + $suffix = ''; + + if ($this->isLongFormNeeded() && !empty($this->formField->arrayName)) { $names = HtmlHelper::nameToArray($this->formField->arrayName); - $name = $this->formField->getName('RLTranslate[' . $code . '][' . implode('][', $names) . ']'); - } else { - $name = $this->formField->getName('RLTranslate['.$code.']'); + $suffix = '[' . implode('][', $names) . ']'; } - return $name; + return $this->formField->getName('RLTranslate['.$code.']' . $suffix); } /**