Skip to content

Commit 860a30a

Browse files
committed
fix(localization): #793 fix language variables path for custom table name (#873)
1 parent 7d9a1d1 commit 860a30a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/helpers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ function fill_template_with_field_data($variables, $fieldVariables, $template, $
193193
function fill_template_with_field_data_locale($variables, $fieldVariables, $template, $field)
194194
{
195195
$template = fill_template($variables, $template);
196-
$tableName = $variables['$TABLE_NAME$'];
196+
$modelName = $variables['$MODEL_NAME_PLURAL_CAMEL$'];
197197

198-
return fill_field_template_locale($fieldVariables, $template, $field, $tableName);
198+
return fill_field_template_locale($fieldVariables, $template, $field, $modelName);
199199
}
200200
}
201201

@@ -206,15 +206,15 @@ function fill_template_with_field_data_locale($variables, $fieldVariables, $temp
206206
* @param array $variables
207207
* @param string $template
208208
* @param GeneratorField $field
209-
* @param string $tableName
209+
* @param string $modelName
210210
*
211211
* @return string
212212
*/
213-
function fill_field_template_locale($variables, $template, $field, $tableName)
213+
function fill_field_template_locale($variables, $template, $field, $modelName)
214214
{
215215
foreach ($variables as $variable => $key) {
216216
$value = $field->name;
217-
$template = str_replace($variable, "@lang('models/$tableName.fields.$value')", $template);
217+
$template = str_replace($variable, "@lang('models/$modelName.fields.$value')", $template);
218218
}
219219

220220
return $template;

0 commit comments

Comments
 (0)