diff --git a/app/assets/javascripts/suggest.js.coffee b/app/assets/javascripts/suggest.js.coffee index 854f7ccf1..c8e242cf6 100644 --- a/app/assets/javascripts/suggest.js.coffee +++ b/app/assets/javascripts/suggest.js.coffee @@ -9,11 +9,15 @@ App.Suggest = callback = -> $.ajax url: $this.data("js-url") - data: { search: $this.val() }, - type: "GET", + data: + search: $this.val() + type: "GET" dataType: "html" success: (stHtml) -> js_suggest_selector = $this.data("js-suggest") + if js_suggest_selector.startsWith(".") + locale = $this.closest(".translatable-fields").data("locale") + js_suggest_selector += "[data-locale=#{locale}]" $(js_suggest_selector).html(stHtml) timer = null