Option to use own name, reply-to, subject and message fields
Redmine is using the default language only when it cannot determine the language a user’s browser supports. E.g. if a browser sends the HTTP header
Accept-Language en-us,en;q=0.5 then it won’t use the default language configured (de in my case) in the redmine settings.
This ends up with mixed languages in the contact form. It’d be nice if one can disable the default form fields full name, reply-to, subject and message.
#1 Updated by Andriy Lesyuk about 10 years ago
- Status changed from New to Incomplete
Do you mean disable translation?
#2 Updated by Romain Schmitz about 10 years ago
Not at all.
I wish my redmine to always use the German translation but it’s just disrespecting the default language when the browser doesn’t define de in
Accept-Language de-de,de ....
Most people think that the default language is permanently used but this hardly depends on the user’s browser which makes it difficult to always provide a website in a specific language no matter what the browser supports.
I need my website in German only but if the browser tells the server that it only understands English, the English translation of redmine’s view parts are provided.
In my case your plugin or more precisely its custom fields were in German as expected, but since you use the original redmine fields for the name, reply-to etc. they were provided in English.
I propose to ask the user whether to use redmine’s fields or own fields. A pseudo code to illustrate what I mean:
<%pseudo if (use_redmine_fields) then> <p><%= f.text_field(:full_name, :size => 30, :required => true) %></p> <p><%= f.text_field(:reply_to, :size => 30, :required => true) %></p> <p><%= f.text_field(:subject, :size => 80, :required => true) %></p> <p><%= f.text_area(:message, :cols => 80, :rows => 15, :class => Setting.plain_text_mail? ? '' : 'wiki-edit', :required => true, :accesskey => accesskey(:edit)) %></p> <%pseudo end> <% email.custom_field_values.each do |value| %> <p><%= custom_field_tag_with_label(:contact_form, value) %></p> <% end %>
When the user doesn’t wish to use the original redmine fields, the user must have defined the appropriate custom fields for those.
I hope you got me.
There are surely tons of better solutions but I’m not a ruby programmer and I feel hard to like its syntax at the moment.