{"id":15631627,"url":"https://github.com/fphilipe/i18n-debug","last_synced_at":"2025-04-13T00:46:26.508Z","repository":{"id":17746819,"uuid":"20592650","full_name":"fphilipe/i18n-debug","owner":"fphilipe","description":"Ever wondered which translations are being looked up by Rails, a gem, or simply your app? Wonder no more!","archived":false,"fork":false,"pushed_at":"2023-01-17T12:58:25.000Z","size":17,"stargazers_count":186,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T00:46:22.476Z","etag":null,"topics":["debug","i18n","rails","ruby","translation"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fphilipe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-07T12:31:24.000Z","updated_at":"2025-02-02T14:54:50.000Z","dependencies_parsed_at":"2023-02-10T09:45:14.803Z","dependency_job_id":null,"html_url":"https://github.com/fphilipe/i18n-debug","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphilipe%2Fi18n-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphilipe%2Fi18n-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphilipe%2Fi18n-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphilipe%2Fi18n-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fphilipe","download_url":"https://codeload.github.com/fphilipe/i18n-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650432,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","i18n","rails","ruby","translation"],"created_at":"2024-10-03T10:41:02.555Z","updated_at":"2025-04-13T00:46:26.490Z","avatar_url":"https://github.com/fphilipe.png","language":"Ruby","readme":"# Ruby I18n Debug\n\n[![Build Status][build-image]][build-link]\n[![Gem Version][gem-image]][gem-link]\n\n**Ever wondered which translations are being looked up by Rails, a gem, or\nsimply your app? Wonder no more!**\n\nRails' implicit translations, for instance, are a nice feature. But sometimes\ngetting the key to, let's say, the `BillingAddress`' `street` attribute in\na nested form inside an `Order` can be quite tricky to get right on the first\ntry. The key for this example would be\n`activerecord.attributes.order/billing_address.street`. Good luck figuring that\nout!\n\nWith this gem you can easily see which translations are being looked up. The key\nabove would have created the following debug log entry:\n\n```\n[i18n-debug] activerecord.attributes.order/billing_address.name =\u003e nil\n```\n\nAfter setting the translation for that key you just discovered, the log entry\nchanges to this:\n\n```\n[i18n-debug] activerecord.attributes.order/billing_address.name =\u003e \"Order billing name\"\n```\n\n## Installation\n\nSimply add the gem to your `Gemfile`. You probably only want this in development.\nThus, place it inside the `development` group.\n\n```ruby\ngem 'i18n-debug', group: :development\n```\n\nIf you need support for ruby \u003c= 2.0, make sure to use version 1.0.0.\n\n## Usage\n\nThis gem works straight out of the box. If Rails is available, it will log using\n`Rails.logger.debug`. Otherwise it will log using `Logger.new($stdout).debug`.\n\nIf you wish to use a custom logger, simply set it as follows (make sure it\nresponds to `debug`):\n\n```ruby\nI18n::Debug.logger = my_custom_logger\n```\n\nEvery lookup invokes the lambda `I18n::Debug.on_lookup` with the key and the\ntranslation value as arguments. The default lambda simply logs it to the logger\nmentioned above. If you want to change the logging format or do something\ntotally different, simply set your own handler to do so:\n\n```ruby\n# Collect stats on I18n key usage.\ni18n_stats = Hash.new { |stats, key| stats[key] = 0 }\n\nI18n::Debug.on_lookup do |key, value|\n  i18n_stats[key] += 1 if value\nend\n```\n\n## Additional Information\n\n### Dependencies\n\n- [i18n](https://github.com/svenfuchs/i18n)\n\n### Author\n\nPhilipe Fatio ([fphilipe](https://github.com/fphilipe))\n\n### License\n\nMIT License. Copyright 2014 Philipe Fatio\n\n[build-image]: https://travis-ci.org/fphilipe/i18n-debug.svg\n[build-link]:  https://travis-ci.org/fphilipe/i18n-debug\n[gem-image]:   https://badge.fury.io/rb/i18n-debug.svg\n[gem-link]:    https://rubygems.org/gems/i18n-debug\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffphilipe%2Fi18n-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffphilipe%2Fi18n-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffphilipe%2Fi18n-debug/lists"}