DEV Community

Jeremy Davis
Jeremy Davis

Posted on • Originally published at blog.jermdavis.dev on

1 1

The language of your Sitecore Forms is more important than you thought

Every so often I run up against an issue that’s right there in the docs, but somehow has passed me by. This week that issue was Sitecore’s new V9 forms implementation, and it’s relationship with languages…

_ Edited to add: _ Sitecore seem to have managed to push out a fix for this in the time between me starting to write this and publishing it… If you deploy v9.0 Update 2 this should be resolved, according to the release notes. But I’ll post this anyway because not everyone will upgrade right away…

If you’re working in a situation where your default content language isn’t “en“, and you try to create a new Sitecore form, you may get a bit confused. I was creating forms on a site where “en-GB” was the default:

And it was set in the config:

I could happily create a new form via the shiny new form editor, and save it:

And the form would appear in the content tree:

But when you come back to the “choose a form to edit” view in the designer:

Where’s it gone? Cue some head-scratching…

Now there are a few blog posts about that discuss the issue of forms not being visible when you try to return to them. But these weren’t an issue in my specific case.

So digging a bit I noticed that even with the default language being “en-GB” for the site, the ajax requests that are being made to populate the “pick your form” UI are:

http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7B60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C%7D&sc\_content=master&language=en&fields=\_\_Created%7C\_\_Updated%7C\_\_Thumbnail&pageIndex=0&pageSize=25

http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7BA7C51A03-028A-4414-98DF-116DFAEAE5A6%7D&sc\_content=master&language=en&sorting=d\_\_smallcreateddate&fields=\_\_Created%7C\_\_Created%20by%7C\_\_Updated%7C\_\_Updated%20by%7CClassification%7C\_\_Thumbnail&pageIndex=0&pageSize=50
Enter fullscreen mode Exit fullscreen mode

and

http://site/-/item/v1/sitecore/shell?sc\_itemid=%7BAC27A304-1EED-487B-965E-C993C561C6A7%7D&sc\_database=core&language=en
Enter fullscreen mode Exit fullscreen mode

What’s special about those? Well they all include the clause: “language=en” and we know (thanks to our default language) that our form items don’t have a version in that language:

So, what happens if we just add a version in the “en” language? Well pretty much instantly, we can see:

Success!

Now it’s only the root item of the form which needs updating to make the form visible:

If you actually want to have proper language variations of the form itself, you can use the form editing UI to decide which language you want to edit:

You don’t need to manually create any of the other versions via Content Editor. But of course you need the form to be visible in the Forms editor in the first place to make that work…

Now, this issue is mentioned in Sitecore’s documentation for the forms editor:

But if your default language is something other than “en” it’s easier said than done to follow the instruction to “first save the form in the default language” – so until we get an update that fixes the choice of language for the UI’s search queries, you may have to keep adding the “en” version of your form items manually…

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay