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

Is regex matching the only way to get static strings? #2

Open
missmatsuko opened this issue Aug 16, 2019 · 2 comments
Open

Is regex matching the only way to get static strings? #2

missmatsuko opened this issue Aug 16, 2019 · 2 comments

Comments

@missmatsuko
Copy link

enupal/translate also looks for static strings in Twig templates with regex matching. It doesn't seem very reliable, and seems to be the cause of many of their issues.

Maybe yours regex pattern works better, but I wonder if there's a way to hook into the template or parse it so you're actually getting what's being passed through the translation filter?

@jan-dh
Copy link
Owner

jan-dh commented Aug 19, 2019

The reason I made this plugin was because I felt there wasn't enough native support for static translations. I've been looking around before making the field, but haven't found a way to get the parsed values. I guess that would require a full parsing of all templates which doesn't sound too good.

If you would happen to find any resources on other ways to access translations, you would make me very happy 🙂 .

@missmatsuko
Copy link
Author

The info here looks like it might be helpful... sorry, I'm not familiar enough with it.
https://twig-extensions.readthedocs.io/en/latest/i18n.html#extracting-template-strings

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

2 participants