{"action":"created","issue":{"url":"https://api.github.com/repos/i18next/i18next/issues/412","labels_url":"https://api.github.com/repos/i18next/i18next/issues/412/labels{/name}","comments_url":"https://api.github.com/repos/i18next/i18next/issues/412/comments","events_url":"https://api.github.com/repos/i18next/i18next/issues/412/events","html_url":"https://github.com/i18next/i18next/issues/412","id":93957078,"number":412,"title":"Change classes by a language.","user":{"login":"dfdgsdfg","id":474775,"avatar_url":"https://avatars.githubusercontent.com/u/474775?v=3","gravatar_id":"","url":"https://api.github.com/users/dfdgsdfg","html_url":"https://github.com/dfdgsdfg","followers_url":"https://api.github.com/users/dfdgsdfg/followers","following_url":"https://api.github.com/users/dfdgsdfg/following{/other_user}","gists_url":"https://api.github.com/users/dfdgsdfg/gists{/gist_id}","starred_url":"https://api.github.com/users/dfdgsdfg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfdgsdfg/subscriptions","organizations_url":"https://api.github.com/users/dfdgsdfg/orgs","repos_url":"https://api.github.com/users/dfdgsdfg/repos","events_url":"https://api.github.com/users/dfdgsdfg/events{/privacy}","received_events_url":"https://api.github.com/users/dfdgsdfg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-09T05:13:48Z","updated_at":"2015-07-13T11:00:26Z","closed_at":null,"body":"Hello. Is there any way change css classes by language? Or maybe the best practice?\r\n\r\nI imagine like below. If we use a css selector of attribute, It's very useful.\r\n\r\n```html\r\n<span class=\"status\" data-i18n=\"good\"></span>\r\n```\r\n```json\r\n{ \r\n  \"en\": {\r\n    \"good\": \"good\"\r\n  },\r\n  \"ko\": {\r\n    \"good\": \"좋음\"\r\n  }\r\n}\r\n```\r\n```css\r\n.status[data-lang=\"en\"] {\r\n  color: red;\r\n}\r\n\r\n.status[data-lang=\"ko\"] {\r\n  color: blue;\r\n}\r\n```\r\n\r\n- <https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors>\r\n- <http://toddmotto.com/stop-toggling-classes-with-js-use-behaviour-driven-dom-manipulation-with-data-states/>\r\n\r\nWhat about this? Or any other good option which I can use the right way?"},"comment":{"url":"https://api.github.com/repos/i18next/i18next/issues/comments/120890789","html_url":"https://github.com/i18next/i18next/issues/412#issuecomment-120890789","issue_url":"https://api.github.com/repos/i18next/i18next/issues/412","id":120890789,"user":{"login":"jamuhl","id":977772,"avatar_url":"https://avatars.githubusercontent.com/u/977772?v=3","gravatar_id":"","url":"https://api.github.com/users/jamuhl","html_url":"https://github.com/jamuhl","followers_url":"https://api.github.com/users/jamuhl/followers","following_url":"https://api.github.com/users/jamuhl/following{/other_user}","gists_url":"https://api.github.com/users/jamuhl/gists{/gist_id}","starred_url":"https://api.github.com/users/jamuhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamuhl/subscriptions","organizations_url":"https://api.github.com/users/jamuhl/orgs","repos_url":"https://api.github.com/users/jamuhl/repos","events_url":"https://api.github.com/users/jamuhl/events{/privacy}","received_events_url":"https://api.github.com/users/jamuhl/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T11:00:26Z","updated_at":"2015-07-13T11:00:26Z","body":"we might add a option here https://github.com/i18next/i18next/blob/master/src/i18next.jquery.js#L20 to set the language on the translated element. (so setting eg. setLngAttribute to true will add data-i18n-lng='en' to elements)\r\n\r\ni could add this on next release. to fasten this up or if you need that urgent a PR would be welcome."}}