Skip to content

:scope is not handled properly for inline translations #95

Description

@Silex

This uses the wrong key when doing inline translations:

s = 'person'
t('first_name', scope: s)`

Looking at https://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/simple.rb#L78, I guess there's a way to use normalize_keys or something else to figure out the scope properly.

Right now I do this workaround:

s = 'person'
t(format('%s.first_name', s))`

Another options could be to handle :scope in https://github.com/prograils/lit/blob/master/lib/lit/i18n_backend.rb#L19, but I'm afraid of breaking many things if I simply go key = format('%s.%s', key, options[:scope] if options[:scope].present?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions