Skip to content

Catch also translation strings with parameters #1

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ManuDoni
Copy link

@ManuDoni ManuDoni commented Oct 5, 2022

  • Catch also translation strings with parameters
  • Fix: catch also white spaces or line breaks outside the translation string

I changed the regex to catch translation string with parameters like this: __('Hello :user_name', ['user_name' => $user->name]) and even this weird one:

__(
    'Hello :user_name'
    , // I deliberately put this comma here
    ['user_name' => $user->name]
)

* Catch also translation strings with parameters
* Fix: catch also white spaces or line breaks outside the translation string

I changed the regex to catch translation string with parameters like this: `__('Hello :user_name', ['user_name' => $user->name])` and even this weird one:
```
__(
    'Hello :user_name'
    , // I deliberately put this comma here
    ['user_name' => $user->name]
)
```
@ManuDoni
Copy link
Author

ManuDoni commented Oct 5, 2022

I can also confirm that this package works for laravel 9

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

Successfully merging this pull request may close these issues.

1 participant