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

trans_choice not picked up #16

Closed
tfortier opened this issue Apr 28, 2017 · 6 comments
Closed

trans_choice not picked up #16

tfortier opened this issue Apr 28, 2017 · 6 comments

Comments

@tfortier
Copy link

Hi,

Great package, thanks for that!

One tiny little hiccup for me is I was using {{ trans('Some string') }} and those didn't get picked up by the scan. I changed them all to __('') which were scanned properly.

That does leave me with quite a few {{ trans_choice(...) }} that are not getting scanned.

Do you plan on supporting those at some point?

@danijelk
Copy link
Contributor

It's in my pull request, which will probably be merged within the next 24h if the author doesn't have any more comments, this will enable you to add your functions that your project uses instead of the static '__'

@themsaid
Copy link
Owner

trans() and trans_choice() can be used for array translations as well, that's why we don't scan for them by default, however you can add a localization_methods config key which is available since 0.1.2.

'localization_methods' => ['__', 'trans', 'trans_choice'],

@tfortier
Copy link
Author

tfortier commented May 1, 2017

After running composer update and fetching the new version, the translation tool seems utterly confused so I must be missing something.

I emptied my en.json and fr.json files and made a scan. Instead of the 100+ items it found previously I now have only three results : __, trans and trans_choice.

My config file looks like this :

<?php

return [
    'base_language' => 'fr',
    'localization_methods' => ['__', 'trans', 'trans_choice'],
    'route_group_config' => [
        'middleware' => ['web'],
        'namespace' => 'Themsaid\LangmanGUI'
    ]
];

@themsaid
Copy link
Owner

themsaid commented May 1, 2017

@tfortier I just released a new fix on v0.1.3, give it a try.

@tfortier
Copy link
Author

tfortier commented May 1, 2017

Works like a charm. Thank you very much 👍

@themsaid
Copy link
Owner

themsaid commented May 1, 2017

Welcome :)

@themsaid themsaid closed this as completed May 1, 2017
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