Skip to content

Commit

Permalink
Implement Reverso Context: part 1 #19 - Fix: getting selected languag…
Browse files Browse the repository at this point in the history
…es in ReversoContext
  • Loading branch information
filimo committed Oct 12, 2019
1 parent be47490 commit e07e2f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReaderTranslator/Components/ReversoContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct ReversoContext : ViewRepresentable, WKScriptsSetup {
print("ReversoContext_updateView")

let search = text.replacingOccurrences(of: " ", with: "+")
let language = view.url?.absoluteString.groups(for: #"\/translation\/(.+)\/"#)[safe: 0]?[safe: 1] ?? "english-russian"
let language = view.url?.absoluteString.groups(for: #"\/translation\/(\w+-\w+)\/"#)[safe: 0]?[safe: 1] ?? "english-russian"
let urlString = "\(host)\(language)/\(search)"

if view.url?.absoluteString == urlString { return }
Expand Down

0 comments on commit e07e2f8

Please sign in to comment.