ruby-i18n / ruby-i18n/i18n

Logging used translation keys

Open
#712 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1k
Forks
415
Avg merge
2d 3h
Merged PRs (30d)
1

Description

Hi,
we would like to log which translation keys are actually used in production (for a limited time period). I was wondering how to hook into i18n to intercept all translate calls. I tried a couple of ways, like introducing a custom helper that overrides the default t method call in templates. Works okay, but I only get partial keys like .title and I would like full ones. This also doesn't work for I18n.t calls outside templates. I tried extending I18n module but couldn't make it work.

What would be the best way to get "full-key" logging working?
Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the template helper approach, the t calls that produce partial keys, and the I18n.t calls outside templates described in the issue. A solution would need a defined interception point for full-key logging and a testable way to confirm that both call styles are captured.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.