Skip to content

Commit f465700

Browse files
committed
feat: use translation locale when fetching the record value
1 parent e03c20c commit f465700

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/IsTranslatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function getAttribute($key): mixed
212212

213213
// Translate using the current app locale if possible
214214
if ($this->isTranslatable($key)) {
215-
$translated_value = $this->translate($key, app()->currentLocale());
215+
$translated_value = $this->translate($key, translation_locale());
216216

217217
// Return translated value if not null, otherwise fallback to original value
218218
return $translated_value ?? parent::getAttribute($key);

0 commit comments

Comments
 (0)