# Unknown translation type?

**URL:** <https://forum.shopware.com/t/unknown-translation-type/72554>\
**Category:** Programmierung\
**Created:** [4. Februar 2021 um 11:58 UTC](https://forum.shopware.com/t/unknown-translation-type/72554 "2021-02-04T11:58:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [4. Februar 2021 um 11:58 UTC](https://forum.shopware.com/t/unknown-translation-type/72554/1 "2021-02-04T11:58:50Z")

</div>

Ich habe hier einen Shop, wo die Artikel über die REST API einglesen werden. Jetzt tauchen im Log zahlreiche Fehler auf wie:

```
Got error 'PHP message: PHP Fatal error:  
Uncaught Shopware\\Components\\Api\\Exception\\CustomValidationException: 
Unknown translation type 8 in /var/.../engine/Shopware/Components/Api/Resource/Translation.php:536\nStack trace:\n

#0 /var/.../engine/Shopware/Components/Api/Resource/Translation.php(101): Shopware\\Components\\Api\\Resource\\Translation->getIdByNumber('8', '8')\n
#1 /var/.../engine/Shopware/Components/Api/Resource/Resource.php(312): Shopware\\Components\\Api\\Resource\\Translation->getIdByData('89')\n
#2 /var/.../engine/Shopware/Controllers/Api/Rest.php(91): Shopware\\Components\\Api\\Resource\\Resource->batch(Array)\n
#3 /var/.../engine/Library/Enlight/Controller/Action.php(192): Shopware_Controllers_Api_Rest->batchAction()\n
#4 /var/.../engine/Library/Enlight/Controller/Dispatcher/Default.php(4...'

```

Zu den Artikeln werden auch die Übersetzungen übermittelt und mittels PUT translations geschrieben. Als ‘type’ ist immer fest ‘article’ eingestellt.

```
// Der Aufbau ist wie folgt (vereinfacht)

$new_en = [ 
  'key' => ID Artikel, 
  'type' => 'article',
  'shopId' => 2,
  'data' => [
   'name' => Name,
   'description' => Beschreibung,
   'descriptionLong' => Beschreibung,
   'metaTitle' => Name,
   'packUnit' => Stück etc.,
   '__attribute_attr5' => Zusatztext,
   ]
];
 
$SW->put('translations', $new_en );

```

**Wie muss ich denn jetzt diese Fehler genau verstehen?**

&nbsp;

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [5. Februar 2021 um 12:42 UTC](https://forum.shopware.com/t/unknown-translation-type/72554/2 "2021-02-05T12:42:15Z")

</div>

Ich habe das jetzt noch einmal genauer untersucht, aber so richtig sehe ich jetzt nicht was falsch sein sollte:

```
// Update Artikel ID 1 in DB

Array
(
    [0] => OK
    [1] => Array
        (
            [success] => 1
            [data] => Array
                (
                    [id] => 1
                    [location] => https://.../api/articles/1
                )

        )

    [2] => {"success":true,"data":{"id":1,"location":"https:\/\/...\/api\/articles\/1"}}
)

// Update Translation ID 1 in DB

Array
(
    [key] => 1
    [type] => article
    [shopId] => 2
    [data] => Array
        (
            [name] => glass tealight cup
            [description] => 
            [descriptionLong] => 
            [metaTitle] => glass tealight cup
            [packUnit] => Stück
            [__attribute_attr5] => 
        )

)

// Fehler im Server Log

Array
(
    [0] => Error
    [1] => 
    [2] => 

Fatal error: Uncaught Shopware\Components\Api\Exception\CustomValidationException: 
Unknown translation type 1 in /var/.../engine/Shopware/Components/Api/Resource/Translation.php:536
Stack trace:

```

**Was soll das? Muss ich die Übersetzung von Artikel selber per MySQL in die DB schreiben?**
