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

Avatar rating text is not translated properly if a user has a custom language set #88

Closed
dkotter opened this issue Nov 16, 2021 · 1 comment · Fixed by #89 or #175
Closed

Avatar rating text is not translated properly if a user has a custom language set #88

dkotter opened this issue Nov 16, 2021 · 1 comment · Fixed by #89 or #175
Assignees
Labels
help wanted type:bug Something isn’t working.
Milestone

Comments

@dkotter
Copy link
Collaborator

dkotter commented Nov 16, 2021

Describe the bug
Reported here. The Avatar Rating text is translated properly if a site language is set but not if a user language is set.

Looking into it, I believe it's related to this: https://make.wordpress.org/core/2016/11/07/changed-loading-order-for-current-user-in-4-7/. Basically where we have those strings set is loaded prior to the user object being initialized, so the user's set language is never available and thus won't be considered when translating.

There may be other approaches but it may be as simple as moving those text strings to the actual function that needs them, which should be late enough in the loading process to fix the problem. We do use the avatar ratings (G, PG, etc) in other places, so those need to stay but the actual text strings are only used in a single location.

Steps to Reproduce

  1. Select a site language other than English (es_ES for instance). Ensure proper language packs get installed
  2. Go to your profile page and note the Avatar Rating text is translated
  3. Turn site language back to english
  4. Set user language to a different language (es_ES again)
  5. Note the Avatar Rating text is not translated

Expected behavior
All text should be translated if a different language is chosen and translations are available

@ActuallyConnor
Copy link
Contributor

Hey @dkotter here's a simple PR I made to fix this issue #89

Let me know if you have any questions 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment