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

Bug: blade files cannot be localized (Sage 10-beta.2) #2929

Closed
5 tasks done
SergiArias opened this issue Jan 4, 2022 · 4 comments
Closed
5 tasks done

Bug: blade files cannot be localized (Sage 10-beta.2) #2929

SergiArias opened this issue Jan 4, 2022 · 4 comments
Labels

Comments

@SergiArias
Copy link

SergiArias commented Jan 4, 2022

Terms

Description

In Sage 10.0.0-beta.1, all blade views were cached as php files in storage folder. Now this is not happening (I am not sure if it's intended). The problem is that I cannot use localization functions like __('Some string', 'sage') as they won't be catched by the pot file generator.

Steps To Reproduce

 <h2>{!! __('Frequently asked questions', 'sage') !!}</h2>

Expected Behavior

The string should be catched by the pot file generator

Actual Behavior

The string is ignored by the pot file generator as it's not inside a php file

Relevant Log Output

No response

Versions

10.0.0-beta-2

@SergiArias SergiArias added the bug label Jan 4, 2022
@SergiArias
Copy link
Author

It's related to this pull request: #2837
Being the views now in wp-content instead of the theme itself, how can we localize strings?

@retlehs
Copy link
Member

retlehs commented Jan 4, 2022

is this not a dupe of #2672 (comment)? (it seems like paths need to be adjusted?)

can you please update this bug report to be more specific/have more details about the bug? we don't know which commands you're running to generate pot files

@SergiArias
Copy link
Author

I am using Loco Translate plugin to both generate the pot file and translate it, and it looks inside the theme files, not the wp-content ones. I will try the method mentioned in 2672 though and update the bug.

@retlehs
Copy link
Member

retlehs commented Jan 4, 2022

well that definitely makes a difference and absolutely needed to be said earlier haha

i don't think it's reasonable to expect a wordpress plugin to generate a pot file for a theme that's using blade. please followup in #2672 if you have issues with using wp-cli to generate a pot file

@retlehs retlehs closed this as completed Jan 4, 2022
@SergiArias SergiArias mentioned this issue Jan 31, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants