RelationshipFieldType Localization support
Created 5 years ago by brokenhd

I have a related field picker that is showing the name value incorrectly when pulling localized items: https://dha4w82d62smt.cloudfront.net/items/0B12230H061J2f1q2L3l/Screen%20Recording%202018-09-19%20at%2012.37%20PM.gif

The attached item in the German locale is pulling correctly but the name value is incorrect. Inside of my RelationshipFieldType/ValueTableBuilder.php I see the name value inside of the protected $columns and when I change that to entry.name it gives me the English name for the product but not the localized German one. Is there something I am missing here to get the localized value to show up when on the corresponding locale?

ryanthompson  —  5 years ago

Sorry I missed this thread! I think what is probably happening is the translation is being picked up from the active locale.. The value is correct but the localization is still EN for the control panel. Some testing around here will tell us more if you want to give it a shot: https://github.com/anomalylabs/streams-platform/blob/1.3/resources/views/form/partials/fields.twig#L4

We'd probably have to 1.) set the locale on the FT.. which I think is done. But then use that in the table builder or the FT in some way to set it's locale since by default it'll use the currently active locale. If you don't already have this up on github please add it there: https://github.com/pyrocms/pyrocms