I’m trying to add some block level localization of text. I’ve added locale as a custom targeting attribute. I’ve integrated the locale into both my BuilderComponent definition, and recently added it as a userAttribute to my getServerSidePropsbuilder.get call. The localized text looks great in the Visual Editor but as soon as I publish my page, no matter what my browser locale is set to (I’ve tried en-US, en-AU and en-NZ explicitly), it shows the localized text areas as [object Object].
Thank you @aziz ! That was absolutely what the issue was, and I now have proper data showing!
I am a bit confused, though, as to why the Block Level solution didn’t work with passing the locale into the BuilderComponent. If I read the documentation correctly, the Block solution shouldn’t require updates to the getServerSidePropsbuilder.get call.
I’m still seeing a edge case weirdness and I’m not sure if it’s a bug or if I’m trying to do too much.
I’m nesting Symbols, I have a wrapping Symbol that contains 1…n symbols inside of it and the text inside of the nested symbols are localized. But if I have that nesting, it’s as though the nested symbol never receives the locale information from my code, and I again get [object Object] in my UI. FWIW, changing the locale selector in the Visual Editor makes no impact on the nested symbol localized text either, which leads me to believe the locale data isn’t getting passed through.
As a result, I’m detaching the wrapping symbol on each page, but I’m thinking this may be a bug that nobody ever really discovered because most people probably aren’t trying to do this kind of weird combination of nesting and localization.
It’s not an immediate showstopper since I can detach symbols, but it’d be nice if this CAN be fixed for it to be fixed. Thanks!