]> cat aescling's git repositories - mastodon.git/commit
Language detection refactor (#2099)
authorMatt Jankowski <mjankowski@thoughtbot.com>
Tue, 18 Apr 2017 20:20:12 +0000 (16:20 -0400)
committerEugen <eugen@zeonfederated.com>
Tue, 18 Apr 2017 20:20:12 +0000 (22:20 +0200)
commit297c11dba2864b20992cd3f98282f5ce35d5d144
treefd4c3e3ec0c981b417931708c7f88cd25e6282c9
parent0a7588282a00513af9631d06eea76878a974c659
Language detection refactor (#2099)

* Extract detect_language to separate class

* Use default locale, not just en

* Add spec to confirm that whatlanguage cant identify empty string

* Allow account locale to override default in language detector

* PostStatusService supplies an account to detect language
app/lib/language_detector.rb [new file with mode: 0644]
app/services/post_status_service.rb
spec/lib/language_detector_spec.rb [new file with mode: 0644]
spec/services/post_status_service_spec.rb