# Automatically detect client's locale setting

**URL:** <https://www.ruby-forum.com/t/automatically-detect-clients-locale-setting/155321>\
**Category:** Rails I18n\
**Created:** [December 10, 2008, 3:59pm UTC](https://www.ruby-forum.com/t/automatically-detect-clients-locale-setting/155321 "2008-12-10T15:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 10, 2008, 3:59pm UTC](https://www.ruby-forum.com/t/automatically-detect-clients-locale-setting/155321/1 "2008-12-10T15:59:41Z")

</div>

Hi,

Does I18n provide any easy feature to detect the client’s browser  
locale?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [January 13, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/automatically-detect-clients-locale-setting/155321/2 "2009-01-13T20:25:43Z")

</div>

Hi Fernando,

had the same problem, but solving was quite easy:

I18n.locale =  
request.headers[‘HTTP\_ACCEPT\_LANGUAGE’].split(’,’)[0].split(’-’)[0]

greetings  
Christian

Fernando P. wrote:

> Hi,
> 
> Does I18n provide any easy feature to detect the client’s browser  
> locale?
