Make WordPress Core

Opened 10 years ago

Last modified 3 months ago

#38643 accepted enhancement

Show toolbar (admin bar) in the user's locale (language)

Reported by: swissspidy Owned by: pbearne
Priority: normal Milestone: Future Release
Component: I18N Version: 4.7
Severity: normal Keywords: needs-patch
Cc: Focuses:

Description

After #29783 and #26511 it might make sense to show the toolbar on the front-end in the user's locale, while keeping the rest of the site in the site's locale.

#29783 actually has a proof-of-concept for that. Screenshot: https://twitter.com/swissspidy/status/773571032963751936

Attachments (2)

38643.diff (2.0 KB ) - added by swissspidy 10 years ago.
38643.WIP.diff (2.0 KB ) - added by sabernhardt 5 years ago.

Download all attachments as: .zip

Change History (28)

@swissspidy
10 years ago

#1 @swissspidy
10 years ago

  • Keywords has-patch added

38643.diff should do the trick. Post type labels need to be fixed first though. See discussion at #26511 for this.

#2 @swissspidy
10 years ago

#39068 was marked as a duplicate.

#3 @swissspidy
10 years ago

#38218 is a possible solution for the post type labels.

#4 @swissspidy
8 years ago

  • Milestone Awaiting ReviewFuture Release

#5 @swissspidy
7 years ago

This relies on #41305 being fixed first.

#6 @SergeyBiryukov
7 years ago

#46759 was marked as a duplicate.

#7 @sabernhardt
5 years ago

#51654 was marked as a duplicate.

#9 @SergeyBiryukov
5 years ago

#53442 was marked as a duplicate.

#10 @sabernhardt
5 years ago

I refreshed the previous patch against trunk, and it still needs some work.

Of course, it does not include the lazily evaluated translations (#41305).

Also, the toolbar container should have a lang attribute when the profile language does not match the page (whether that is in the site default or a third language).

Last edited 3 months ago by sabernhardt (previous) (diff)

#11 @ocean90
5 years ago

#53794 was marked as a duplicate.

#12 @sebastienserre
4 years ago

  • Keywords needs-refresh changes-requested added

This ticket was mentioned in Slack in #core-i18n by sabernhardt. View the logs.


3 years ago

#14 @johnbillion
2 years ago

#60627 was marked as a duplicate.

#15 @oglekler
2 years ago

  • Summary Show toolbar in the user's localeShow toolbar (admin bar) in the user's locale (language)

I am changing the Summary to make it easier to find this ticket. I believe that this is called Admin bar, so I didn't search for a toolbar

This ticket was mentioned in PR #7077 on WordPress/wordpress-develop by @pbearne.


2 years ago
#16

  • Keywords needs-refresh removed

Updated the admin bar styles in WordPress, adding a function to automatically set the text direction based on the user's locale. This helps ensure correct rendering of the admin bar for right-to-left languages. The function also restores the previous locale after rendering the admin bar.

#17 @pbearne
2 years ago

  • Owner set to pbearne
  • Status newaccepted

refreshed

not sure how to test this :-)

#18 @pbearne
2 years ago

  • Milestone Future Release6.7

@swissspidy commented on PR #7077:


2 years ago
#19

The issue with post type labels being in the wrong locale is still unsolved

This ticket was mentioned in Slack in #core by chaion07. View the logs.


23 months ago

#21 @sabernhardt
23 months ago

  • Milestone 6.7Future Release

Thanks for moving this ticket forward, but it likely will not be ready for 6.7.

#22 follow-up: @swissspidy
21 months ago

  • Component ToolbarI18N
  • Keywords needs-patch added; has-patch changes-requested removed

#23 in reply to: ↑ 22 @pbearne
21 months ago

Replying to swissspidy:

I tried to look at this but could see the issue with the post labels

Can you provide an image of the faulty text?

Version 0, edited 21 months ago by pbearne (next)

#24 follow-up: @swissspidy
21 months ago

It's not a "faulty text". The fundamental problem is that post types are registered in the current locale and then the labels are just translated into the current locale. Switching locales does not have any effect anymore. So even if you show the toolbar in the user's locale (which we had a patch for for 8+ years), the post type labels will always be incorrect, which is very confusing.

There are long prior discussions at #26511 and #38218.

#41305 is probably the only way to truly solve this, which is also mentioned in an earlier comment above. But that has significant drawbacks around backward compatibility.

#25 in reply to: ↑ 24 @pbearne
21 months ago

Replying to swissspidy:

It's not a "faulty text". The fundamental problem is that post types are registered in the current locale and then the labels are just translated into the current locale. Switching locales does not have any effect anymore. So even if you show the toolbar in the user's locale (which we had a patch for for 8+ years), the post type labels will always be incorrect, which is very confusing.

There are long prior discussions at #26511 and #38218.

#41305 is probably the only way to truly solve this, which is also mentioned in an earlier comment above. But that has significant drawbacks around backward compatibility.

I feel this patch is the best we can do for now and a good step in the right direction.
Can we get this added?

#26 @swissspidy
21 months ago

A half-baked solution in this case is arguably worse than just having everything in the same locale. Otherwise we would have probably done it already

#27 @sabernhardt
3 months ago

#65333 was marked as a duplicate.

Note: See TracTickets for help on using tickets.