-
Notifications
You must be signed in to change notification settings - Fork 44
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
The plugin does not respect the user profile language setting in the backend #157
Comments
Same goes for the added settings in the "Discussion" section. |
@lllopo is there a translation on translate.wordpress.org available for language B? |
@jeffpaul Most certainly yes, since my profile language (or so-called language B) is the default Wordpress English. The site language is Dutch and unfortunately the whole admin shows in English (as per my profile preferences) bar the Simple Local Avatar settings which show in Dutch (also one more plugin that has the same problem, but that's irrelevant). |
@jeffpaul I'm the site technical administrator, but I don't speak Dutch. As you can imagine - it is not just a cosmetical annoyance, it is quite a problem for me to do configurations while settings show up in Dutch. |
I have tested and I was able to regenerate this issue, it's a weird behavior - as IMO, it should be handled by the WordPress core itself, or perhaps I might be missing something. |
@faisal-alvi All right, I believe I have this one figured out. In doing some step through debugging, was seeing that our translations are being loaded prior to the function This stirred a memory and I remembered we had a similar issue reported on .org that I added as an issue in #88. This was solved in #89 but since we still had strings being translated early, it seems we still have issues as reported here. I think the easiest fix here is to remove the textdomain from those avatar rating fields, as these strings are the exact same as what core uses (I believe) and as such, there's no need for us to maintain those translations. In testing locally, I changed: $this->avatar_ratings = array(
'G' => __( 'G — Suitable for all audiences', 'simple-local-avatars' ),
'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above', 'simple-local-avatars' ),
'R' => __( 'R — Intended for adult audiences above 17', 'simple-local-avatars' ),
'X' => __( 'X — Even more mature than above', 'simple-local-avatars' ),
); to: $this->avatar_ratings = array(
'G' => __( 'G — Suitable for all audiences' ),
'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above' ),
'R' => __( 'R — Intended for adult audiences above 17' ),
'X' => __( 'X — Even more mature than above' ),
); and it fixed the issue reported here. I also didn't see any other issues from that change but that should be tested a bit more thoroughly. If this is the right approach, we may be able to undo some/all of the changes made in #89, as I think this solution might fix the issue we were attempting to fix there, though again, that would need tested. |
@dkotter This is probably the case. I have an even crazier situation. I'm writing a plugin and wanted to check for some dependencies. So, I do |
Yeah, from what I found, the first time translatable strings are found for a specific text domain, that information is loaded into a global variable. Anytime additional strings are found in that same text domain, it doesn't rebuild that information it just uses what's already in that global variable. I'm sure this helps significantly with performance but what that does mean is if you have strings that are translatable that are loaded prior to We'll work on getting a PR in place to at least fix that here in Simple Local Avatars. Thanks for your report! |
@dkotter Yes, I got to the same conclusion. So now I've offset all of the bootstrapping of my plugin to |
Describe the bug
The plugin does not respect the user profile language setting in the backend.
Steps to Reproduce
What happens: the plugin settings are displayed in language A
Expected behavior: the plugin settings should be displayed in language B
Screenshots, screen recording, code snippet
No response
Environment information
Doesn't matter
WordPress information
WordPress 6.0.2
Simple Local Avatars 2.6.0
Code of Conduct
The text was updated successfully, but these errors were encountered: