Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting locale in frontmatter #5969

Open
IanVS opened this issue Nov 8, 2021 · 1 comment
Open

Allow setting locale in frontmatter #5969

IanVS opened this issue Nov 8, 2021 · 1 comment
Labels
area: i18n good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@IanVS
Copy link

IanVS commented Nov 8, 2021

Is your feature request related to a problem? Please describe.
I am using astro's dynamic routing to build up my urls, and it would be really nice if I could add a hidden locale field to my collection so that it appears in the frontmatter. As it stands, it seems the only way to determine a file's locale is from the path/filename, unless I'm missing another option.

Describe the solution you'd like
Ideally, this would be as easy as adding a field like { name: "locale", label: "Locale", widget: "hidden", default: "{{locale}}", i18n: true},

Describe alternatives you've considered
I tried to create a preSave handler, but it seems to only run once per entry, and expects data to be returned, not the i18n map which contains the data for the localized versions.

@IanVS IanVS added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Nov 8, 2021
@imskr
Copy link

imskr commented Dec 22, 2021

I am working on this @erezrokah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: i18n good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants