decaporg / decaporg/decap-cms

Pass locale to custom preview component

Open
#7,523 0 comments 0 reactions 0 assignees View on GitHub
type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**

I created a custom widget where I select resources from a remote API. In that deployment, I have i18n set up. The field is `i18n: duplicate`

When I open the preview, I would like to fetch the resources from the API to render the right label in the currently edited language. The problem is that in the preview component I do not know which language to display.

**Describe the solution you'd like**

The control get a prop `locale`. It would be good to have the same prop also set to the preview component.

**Describe alternatives you've considered**

**Additional context**

I also noticed that the preview component is not refreshing when edited language is changed. That would also be handy

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.