Project

General

Profile

Error #913 » 0001-redmine-localizable-v0.2.1-to-fix-UTF-8-problems.patch

patch for version 0.2.0 (bumping to 0.2.1) - Marcin Szewczyk, 2014-11-28 23:48

View differences:

redmine/vendor/plugins/localizable/app/views/settings/_localizable.html.erb
77 77
  <tbody>
78 78
  <%- @settings["locales"][element[:name]] = {} if @settings["locales"][element[:name]].nil? -%>
79 79
  <%- element[:objects].each do |object| -%>
80
    <%- if type != object.type.to_s -%>
81
    <%- type = object.type.to_s -%>
80
    <%- if type != object.class.to_s -%>
81
    <%- type = object.class.to_s -%>
82 82
    <tr>
83 83
      <td colspan="<%= @settings["locales_to_translate"].size + 1 %>">
84 84
        <b><em><%= l(type_labels[object.type.to_s.gsub(/CustomField/, "")]) %></em></b>
......
92 92
      </td>
93 93
      <%- @settings["locales_to_translate"].each do |locale| -%>
94 94
      <td align="left">
95
        <input name="settings[locales][<%= element[:name] %>][<%= object.id %>][<%= locale %>]"
96
               value="<%= @settings["locales"][element[:name]][object.id.to_s][locale] %>" />
95
        <input name="settings[locales][<%= element[:name] %>][<%= object.id %>][<%= locale.to_s.force_encoding("UTF-8") %>]"
96
               value="<%= @settings["locales"][element[:name]][object.id.to_s][locale].to_s.force_encoding("UTF-8") %>" />
97 97
      </td>
98 98
      <%- end -%>
99 99
    </tr>
redmine/vendor/plugins/localizable/init.rb
27 27
  author "Emilio González Montaña"
28 28
  author_url "http://ociotec.com"
29 29
  description "This is a plugin for Redmine that is used to show strings (issue types, issue statuses, enumerations, ...) in serveral languages"
30
  version "0.2.0"
30
  version "0.2.1"
31 31
  requires_redmine :version_or_higher => "0.9.0"
32 32
  
33 33
  settings :default => {"default_language" => "en",
redmine/vendor/plugins/localizable/lib/localizable.rb
7 7
        unless Setting["plugin_localizable"]["locales"][type].nil?
8 8
          unless Setting["plugin_localizable"]["locales"][type][id.to_s].nil?
9 9
            unless Setting["plugin_localizable"]["locales"][type][id.to_s][User.current.language.to_s].blank?
10
              value = Setting["plugin_localizable"]["locales"][type][id.to_s][User.current.language.to_s]
10
              value = Setting["plugin_localizable"]["locales"][type][id.to_s][User.current.language.to_s].to_s.force_encoding("UTF-8")
11 11
            end
12 12
          end
13 13
        end
14
- 
    (1-1/1)