Filter localized Metadata

Hello :wave: !

We want to query localized metadata, such as publishedAt or updatedAt for our blogposts model. We noticed though a few caveats:

  • In the UI these metadata are not per locale but per node. Is there a way to have them localized?
  • In graphQL there is a filter option for locale as seen in the imagfe, but regardless of the locale it returns the same data. Even if i query a non existing locale it still returns nodes metadata

Your help is greatly appreciated!

Sorry @technology,

I don’t think this is possible with our content model :frowning: The metadata applies to the whole record, not an individual field or localization.

I think you’d have to manually diff either:

What’s the underlying use case here? Maybe we can help think of a workaround…?

As a workaround, I think you can make a localized timestamp (DateTime) field, and then write a simple a plugin that uses the onBeforeItemUpsert() and onBeforeItemsPublish() event hooks to capture save/publish events and update those timestamps in the record only if that locale has changed. That would just be a normal timestamp field in your schema, not a metadata field.

That should catch changes in the UI, but not via the CMA. If you update records via the CMA, you’ll have to remember to update that localized timestamp field too.

Let me know if you need an example for that?