lib/world_flags/helper/view/util.rb in world-flags-0.3.2.2 vs lib/world_flags/helper/view/util.rb in world-flags-0.3.4
- old
+ new
@@ -27,11 +27,11 @@
def self.flag_options code, title, name, options = {}
locale = WorldFlags.locale(code)
extra_options = title ? {:title => title } : {}
selected = flag_selected?(code, options) ? ' selected' : ''
- language_name = WorldFlags.language(:en, code)
- country_name = WorldFlags.country(:en, code)
+ language_name = WorldFlags.language(locale, code)
+ country_name = WorldFlags.country(locale, code)
# add semi class if not selected
semi = (selected.blank? ? ' semi' : '') if options[:with_semi]
{:class => "flag #{code}#{selected}#{semi}", :'data-country_name' => country_name, :'data-language_name' => language_name, :'data-cc' => code, :'data-locale' => locale}.merge(options[:html] || {}).merge(extra_options)
\ No newline at end of file