Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extractFromFiles is not working with scopes #46

Closed
cyrilchampier opened this issue Aug 21, 2018 · 8 comments
Closed

extractFromFiles is not working with scopes #46

cyrilchampier opened this issue Aug 21, 2018 · 8 comments

Comments

@cyrilchampier
Copy link

if your file contains

i18n.t(patient.import_identifier ? 'with_import_identifier' : 'without_import_identifier',
      { scope: 'booking.patient.format.fullname.long' })

the
extractFromFiles will returns:

[ { key: 'with_import_identifier',
    loc: SourceLocation { start: [Position], end: [Position],
    file: '.../PatientVerificationCard.js' },
  { key: 'without_import_identifier',
    loc: SourceLocation { start: [Position], end: [Position] },
    file:' .../PatientVerificationCard.js' } ]
@oliviertassinari
Copy link
Owner

What would you expect?

@cyrilchampier
Copy link
Author

'booking.patient.format.fullname.long.with_import_identifier'
and
'booking.patient.format.fullname.long.without_import_identifier'

that would then pass the findMissing call

@oliviertassinari
Copy link
Owner

oliviertassinari commented Aug 21, 2018

It's not Ruby on Rails. We have no scopes support.

@cyrilchampier
Copy link
Author

What do you mean by 'We' ?
If you are talking about i18n-js, yes there is:
in the doc, you can find it just before this paragraph

@oliviertassinari
Copy link
Owner

This package doesn't support any scopes feature. It's something I would personally avoid doing but I can understand the need. I'm happy to expose the needed hooks to make it work on your side.

@cyrilchampier
Copy link
Author

I am not sure about what you call hooks.
I though this was a standard supported feature, if it's not, do not worry, we will just avoid them in our code for now :)

@rpellerin
Copy link

I'm happy to expose the needed hooks to make it work on your side

That'd be great!

@oliviertassinari
Copy link
Owner

oliviertassinari commented Aug 23, 2018

@rpellerin What I mean is that its a use case I think this library should allow people to use. I have closed the issue because I have no plan working on it nor I think its a priority. If you need to change something on the library to make it work, like adding a callback to transform the data, let me know. I would be happy to review your pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants