I'm having an issue in Umbraco 7.6.4 with Umbraco Forms 6.0.2.
I have a stack of dictionary items that I'm using to create a multilingual form.
I'm using the approach of adding the hashtag in front of labels/field names to get the correct language on the front end, eg #Company, #Email, etc.
It's all working perfectly for the field name, help text and default value, except that the placeholder value isn't showing as translated, it just shows literally #Company as the placeholder value - it's not even showing the default English value which tells me it isn't being parsed like the other attributes.
Is there a quick fix? Anyone else experiencing the same bug?
I've figured out this issue and implemented a workaround.
I added the code as shown at http://issues.umbraco.org/issue/CON-1161, however rather than putting it in “Views\Partials\Forms\Form.cshtml” as suggested, I needed to enter in into the file “Views\Partials\Forms\Themes\default\Form.cshml”
It’s also worth pointing out the code had to be toward the top of the codeblock and not at the bottom. Ie.
@foreach (FieldViewModel f in c.Fields)
{
bool hidden = f.HasCondition && f.ConditionActionType == FieldConditionActionType.Show;
if (!string.IsNullOrEmpty(f.PlaceholderText) && f.PlaceholderText.StartsWith("#"))
{
f.PlaceholderText = umbraco.library.GetDictionaryItem(f.PlaceholderText.TrimStart("#"));
}
<div class="@Html.GetFormFieldWrapperClass(f.FieldTypeName) @f.CssClass" @{ if (hidden) { <text> style="display: none" </text> } }>
@if (!f.HideLabel)
...
I have just posted on the forum about getting Forms working with multi language sites and then I saw your post.
I wondered if you'd be able to give me an insight into how you have set this up.
I am using v7.6.5 and have tried the # approach by adding the # infront of the field name and then adding the dictionary entries by the same name, this approach works perfectly with the custom drop down lists I have created but not with the form fields. See my screenshots below but if you can offer any advice of this I'd be ever grateful.
Thanks for getting back to me and confirming that what I have done does seem to be right, sometimes I think I am going mad!
I have set the Home node culture setting to be ro-RO and all of my other dictionary entries are working just fine. You can see the culture setting attached and the form on the front end. It just isn't working. I wondered if there was a setting in a config file somewhere or something else I had to edit to get the dictionary working with forms.
No worries at all. All it appears that you've done wrong is entered the key of the dictionary item incorrectly. The key name shouldn't be #Name, rather just Name.
Umbraco Forms multilingual placeholders
Hi all,
I'm having an issue in Umbraco 7.6.4 with Umbraco Forms 6.0.2.
I have a stack of dictionary items that I'm using to create a multilingual form.
I'm using the approach of adding the hashtag in front of labels/field names to get the correct language on the front end, eg #Company, #Email, etc.
It's all working perfectly for the field name, help text and default value, except that the placeholder value isn't showing as translated, it just shows literally #Company as the placeholder value - it's not even showing the default English value which tells me it isn't being parsed like the other attributes.
Is there a quick fix? Anyone else experiencing the same bug?
I've figured out this issue and implemented a workaround.
I added the code as shown at http://issues.umbraco.org/issue/CON-1161, however rather than putting it in “Views\Partials\Forms\Form.cshtml” as suggested, I needed to enter in into the file “Views\Partials\Forms\Themes\default\Form.cshml”
It’s also worth pointing out the code had to be toward the top of the codeblock and not at the bottom. Ie.
Hi Joel.
I have just posted on the forum about getting Forms working with multi language sites and then I saw your post. I wondered if you'd be able to give me an insight into how you have set this up.
I am using v7.6.5 and have tried the # approach by adding the # infront of the field name and then adding the dictionary entries by the same name, this approach works perfectly with the custom drop down lists I have created but not with the form fields. See my screenshots below but if you can offer any advice of this I'd be ever grateful.
Hi Doobear,
What you've got setup in those screenshots is correct. Other than what you've got setup, it should work out of the box.
Have you got screenshots of the front end in English and Romanian to see the output?
Hi Joel,
Thanks for getting back to me and confirming that what I have done does seem to be right, sometimes I think I am going mad!
I have set the Home node culture setting to be ro-RO and all of my other dictionary entries are working just fine. You can see the culture setting attached and the form on the front end. It just isn't working. I wondered if there was a setting in a config file somewhere or something else I had to edit to get the dictionary working with forms.
Again, many thanks.
No worries at all. All it appears that you've done wrong is entered the key of the dictionary item incorrectly. The key name shouldn't be #Name, rather just Name.
Ahhh, Thank you so much, you have saved me a massive headache! It is working perfectly now. Yay!
Thanks again Joel.
is working on a reply...