made em-webfinger errors translatable
This commit is contained in:
parent
e83271ef22
commit
d6f95445c5
2 changed files with 5 additions and 2 deletions
|
|
@ -391,3 +391,6 @@ en:
|
||||||
stream_helper:
|
stream_helper:
|
||||||
show_comments: "show comments"
|
show_comments: "show comments"
|
||||||
hide_comments: "hide comments"
|
hide_comments: "hide comments"
|
||||||
|
webfinger:
|
||||||
|
fetch_failed: "failed to fetch webfinger profile for %{profile_url}"
|
||||||
|
hcard_fetch_failed: "there was a problem fetching the hcard for #{@account}"
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class EMWebfinger
|
||||||
def get_webfinger_profile(profile_url)
|
def get_webfinger_profile(profile_url)
|
||||||
http = EventMachine::HttpRequest.new(profile_url).get OPTS
|
http = EventMachine::HttpRequest.new(profile_url).get OPTS
|
||||||
http.callback{ make_person_from_webfinger(http.response) }
|
http.callback{ make_person_from_webfinger(http.response) }
|
||||||
http.errback{ process_callbacks "failed to fetch webfinger profile for #{profile_url}"}
|
http.errback{ process_callbacks I18n.t('webfinger.fetch_failed', :profile_url => profile_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_person_from_webfinger(webfinger_profile)
|
def make_person_from_webfinger(webfinger_profile)
|
||||||
|
|
@ -86,7 +86,7 @@ class EMWebfinger
|
||||||
process_callbacks "No person could be constructed from this hcard."
|
process_callbacks "No person could be constructed from this hcard."
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
http.errback{process_callbacks "there was a problem fetching the hcard for #{@account}"}
|
http.errback{process_callbacks I18n.t('webfinger.hcard_fetch_failed', :account => @account) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue