-
Notifications
You must be signed in to change notification settings - Fork 448
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
Proposal: add ThemePlugin function to access multilingual theme options #10616
Comments
Happy to forward port this if you like. But I can work around it if you don't want to add things like this to the LTS. PRs: Tests: |
@Godoy0722, I think you've run in to a need for this, if I remember right? Could you have a look? |
Hello everyone. I had to run into a need for this on a private client about two months ago. I used another approach on that time, which was to use
I checked out the commit, and it seems to work great. Just wondering if there's a way to make sure the theme option comes back even when it's not a multilingual option - right now it's just returning null in those cases. Is that supposed to happen? |
Generally speaking I think a piece of data is either multilingual or not. I could add a fallback to the primary language, so that it works the same as |
@NateWr and @Godoy0722, I like the idea of a helper function patterned after |
@asmecher and @Godoy0722 sorry for the delay. I've now added PRs for
This was a little more refactoring than anticipated for a simple helper method. Let me know what you think. |
Not the first or last time I'll hear it! Thanks for your continued good citizenship on this. The PRs all look good to me (and thanks for the split in approach between stable and dev branches). @Godoy0722, could you have a review as well? With your blessing I'll get these included for the next builds. |
Merged -- thanks, all! |
Describe the problem
It's cumbersome to access a multilingual theme option in a template. We have to assign it to a variable and then use the locale key to access it.
Describe the solution
Add a
ThemePlugin
helper function get a localized option value.What application are you using?
I'm proposing to add this to OJS 3.3.
Additional information
I appreciate this is a very minor improvement. But it would align
ThemePlugin::getOption()
with similar data access objects. Not everyone knows that$currentLocale
is available in templates.The text was updated successfully, but these errors were encountered: