Repository: pimcore/pimcore (language: php)

Issue:
[Bug]: Display Issue with Localized Attribute Values
### Pimcore version

11.1.5

### Steps to reproduce

### Description:
 
In Pimcore version 11.1.5, an issue has been identified where the display of localized attribute values in Many-to-Many-Relation/Advanced Many-to-Many-Relation/Many-to-Many-Object-Relation/Advanced Many-to-Many-Object-Relation attributes is not adhering to the selected display language of the object or the user's configured language setting.

![MicrosoftTeams-image (10)](https://github.com/pimcore/pimcore/assets/160856098/e0ea04db-267e-4173-9c2a-33dde2f7a2fa)
 
1. Configure Pimcore to use multiple languages.
2. Create reference objects with localized attribute values. see Category ID 559 "Sports Cars/Sportwagen"
3. Set up an Advanced Many-to-Many-Relation attribute. see Car ID 81 "Cobra 427"
4. Select a different language in the user settings (or in the object display).
5. The localized attribute values continue to display in the original language (an English one) rather than the chosen one.

### Actual Behavior

The localized attribute values remain in the original language, irrespective of the selected display language of the object or the user's chosen language.

### Expected Behavior

The localized attribute values should change according to the selected user's chosen language (or the display language of the object).
This (selected user's chosen language) corresponds to the behavior of the older Pimcore for example version 10.5.8.


Discussion / hints:
Any updates?

Fix patch:
diff --git a/models/DataObject/Service.php b/models/DataObject/Service.php
index 82ca64f514c..86b52dd5f33 100644
--- a/models/DataObject/Service.php
+++ b/models/DataObject/Service.php
@@ -644,7 +644,17 @@ public static function getFieldForBrickType(ClassDefinition $class, string $bric
     private static function getValueForObject(Concrete $object, string $key, string $brickType = null, string $brickKey = null, ClassDefinition\Data $fieldDefinition = null, array $context = [], array $brickDescriptor = null): \stdClass
     {
         $getter = 'get' . ucfirst($key);
-        $value = $object->$getter();
+        $value = null;
+
+        try{
+            $value = $object->$getter(AdminTool::getCurrentUser()?->getLanguage());
+        } catch (\Throwable) {
+        }
+
+        if (empty($value)){
+            $value = $object->$getter();
+        }
+
         if (!empty($value) && !empty($brickType)) {
             $getBrickType = 'get' . ucfirst($brickType);
             $value = $value->$getBrickType();


Test patch: