{"action":"created","issue":{"url":"https://api.github.com/repos/briannesbitt/Carbon/issues/32","labels_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/32/comments","events_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/32/events","html_url":"https://github.com/briannesbitt/Carbon/issues/32","id":18696280,"number":32,"title":"diffForHumans for differend locales","user":{"login":"dirkluijk","id":2102973,"avatar_url":"https://avatars.githubusercontent.com/u/2102973?v=3","gravatar_id":"","url":"https://api.github.com/users/dirkluijk","html_url":"https://github.com/dirkluijk","followers_url":"https://api.github.com/users/dirkluijk/followers","following_url":"https://api.github.com/users/dirkluijk/following{/other_user}","gists_url":"https://api.github.com/users/dirkluijk/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkluijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkluijk/subscriptions","organizations_url":"https://api.github.com/users/dirkluijk/orgs","repos_url":"https://api.github.com/users/dirkluijk/repos","events_url":"https://api.github.com/users/dirkluijk/events{/privacy}","received_events_url":"https://api.github.com/users/dirkluijk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":83,"created_at":"2013-08-28T21:20:14Z","updated_at":"2015-02-23T05:16:33Z","closed_at":null,"body":"Hi,\r\n\r\nWouldn't it be nice to have different translations for the ``Carbon::diffForHumans()`` method?\r\n\r\n```php\r\nsetlocale(LC_TIME, 'nl_NL');                     \r\necho Carbon::now()->subDays(5)->diffForHumans();  // 5 dagen geleden\r\necho Carbon::now()->addDays(5)->diffForHumans();  // over 5 dagen\r\nsetlocale(LC_TIME, '');                           \r\necho Carbon::now()->subDays(5)->diffForHumans();  // 5 days ago\r\necho Carbon::now()->addDays(5)->diffForHumans();  // 5 days from now\r\n```\r\n\r\nI don't know how this should be implemented, but I think (for flexibility) you should be able to:\r\n\r\n- define the format (sequence/position of each part)\r\n- define the units and other texts\r\n\r\nExample configuration:\r\n\r\nen.unit.day = \"day\"\r\nen.unit.days = \"days\"\r\nen.unit.week = \"week\"\r\nen.unit.weeks = \"weeks\"\r\nen.pastNow = \"ago\"\r\nen.futureNow = \"from now\"\r\nen.pastValue = \"before\"\r\nen.futureValue = \"after\"\r\nen.format = \"{value} {unit} {pastNow}{futureNow}{pastValue}{futureValue}\"\r\n\r\nnl.unit.day = \"dag\"\r\nnl.unit.days = \"dagen\"\r\nnl.unit.week = \"week\"\r\nnl.unit.weeks = \"weken\"\r\nnl.pastNow = \"geleden\"\r\nnl.futureNow = \"over\"\r\nnl.pastValue = \"ervoor\"\r\nnl.futureValue = \"erna\"\r\nnl.format = \"{futureNow} {value} {unit} {pastNow}{pastValue}{futureValue}\"\r\n\r\nI think this is a good idea, but I have no idea how this should be implemented. Also the variables names as proposed could be better.\r\n"},"comment":{"url":"https://api.github.com/repos/briannesbitt/Carbon/issues/comments/75490701","html_url":"https://github.com/briannesbitt/Carbon/issues/32#issuecomment-75490701","issue_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/32","id":75490701,"user":{"login":"briannesbitt","id":170745,"avatar_url":"https://avatars.githubusercontent.com/u/170745?v=3","gravatar_id":"","url":"https://api.github.com/users/briannesbitt","html_url":"https://github.com/briannesbitt","followers_url":"https://api.github.com/users/briannesbitt/followers","following_url":"https://api.github.com/users/briannesbitt/following{/other_user}","gists_url":"https://api.github.com/users/briannesbitt/gists{/gist_id}","starred_url":"https://api.github.com/users/briannesbitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briannesbitt/subscriptions","organizations_url":"https://api.github.com/users/briannesbitt/orgs","repos_url":"https://api.github.com/users/briannesbitt/repos","events_url":"https://api.github.com/users/briannesbitt/events{/privacy}","received_events_url":"https://api.github.com/users/briannesbitt/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T05:16:33Z","updated_at":"2015-02-23T05:16:33Z","body":"Just pushed a simple localization of diffForHumans().  Its based on syfony Translation so we can easily handle all languages.\r\n\r\nIf this is good then I merge to master and then we can work on augmenting the localization to other parts."}}