- language_pairs = @lang_list.options.map do |o|
- # these options have values like "en|zh-CN"; map to things like ['en', 'zh_CN'].
- o.value.split('|').map {|l| l.sub('-', '_')}
- end
- super(Translator::Direction.pairs(language_pairs), cache)
+
+ # we can probably safely assume that google translate is able to translate from
+ # any language in the source lang drop down list to any language in the target one
+ # so we create the language pairs based on that assumption
+ sl = @source_list.options.map { |o| o.value.sub('-', '_') }
+ tl = @target_list.options.map { |o| o.value.sub('-', '_') }
+ super(Translator::Direction.all_from_to(tl, sl), cache)