My site's default language is Finnish but I need to use English for admin pages. There should be next to Default language option the second one where user could choose the admin language. I tried also to change language from my user account but it didn't make any change (bug?).
Comments
Comment #1
silverwing CreditAttribution: silverwing commentedOld Issue, but it's a good question - admin in different language? Available, or move to D8?
Comment #2
dddave CreditAttribution: dddave commentedSolution in contrib:
http://drupal.org/project/admin_language
Feature request for D8?
Comment #3
dddave CreditAttribution: dddave commentedShould this live in contrib? If so please set to closed(fixed).
Comment #4
Gábor HojtsyYou can certainly set your user preferred language to whatever language you want and browse the site in that language. That sounds like the easiest, no extra module required :)
Comment #5
Gábor HojtsyMarked #263887: Ability to set language of administrative backend as a duplicate.
Comment #6
plachIn D7 it is possible to move the user language detection method on top and having it prevale over URL language. This allows an admin user to set her preferred interface language. I ain't sure we need something more advanced in D8.
Comment #7
Gábor HojtsyLooks like http://drupal.org/project/admin_language sets one global admin language for the whole site. Is that generally accurate? Thinking about this, it sounds like this would be per-user, so that a multilingual site can be managed by people in their own language. I assume the problems solved here include that the language changes when you hit a node that you want to translate for example, from where admin links would get to keep that modified language, that is not desired. I agree it is probably easy to implement per site instead of per user though, given that if we implement per user, it becomes a problem to display the admin language selector to some people on their profile but not to others. It is hard to tell generally if someone has "some kind of admin access" or not.
Maybe we should think of this as a second session language provider that only applies to admin pages (with a block specific for that to let admins set it?). Blocks don't work well with the Seven theme though... Well, just thinking out loud here :)
Comment #8
plachMy current personal recipe for the scenario described in #7 is:
If I wish to have the possibiliy to switch even interface language:
My main doubt is: do we need some usability improvement to make clear that all of this is actually possibile?
Another possibility might introducing a Role language provider that would allow to configure a language for each available role. But all of this looks to me fairly complex to setup for the average user.
Comment #9
Gábor HojtsyMarked #744656: No translations for admin interface and #289114: Set different presentation language for Admin only as duplicates. There is clearly *lots* of interest in this.
Comment #10
Gábor HojtsyFascinatingly also closed down #427782: All English has gone RTL? as duplicate. Huh.
Comment #11
plachComment #12
Gábor Hojtsy@plach: I think your suggestions from #8 are not entirely good in that they have front-end consequences, when the requestors only want their admin language changed, not to have users fiddle with language changes persisting in their sessions.
Comment #13
LarsKramer CreditAttribution: LarsKramer commentedSubscribing.
It should also be possible to hide the admin language from "Language settings" on the user edit account form if the admin language is not one of the "public" languages. And if the site is a single language site where the admin language is different from the default language, it should be possible to hide "Language Settings".
Comment #14
LarsKramer CreditAttribution: LarsKramer commentedA new 7.x-1.x-dev version of Administration Language has just been released fixing some of what I mentioned in #13.
And it has this feature request: #1239204: Use preferred language on per-user basis instead of global setting
Comment #15
Gábor HojtsyRetitling to better explain the feature request. I've pinged @wulff (the admin_language module maintainer) if he would be interested in integrating some of the module functionality in core. Looking at the code, it seems to be doing numerous other things, like optionally forcing language neutral nodes and path aliases which definitely sound unrelated.
Comment #16
Gábor HojtsyBTW I think the spec for this feature at its most basic form is a language provider that only kicks in for hook_admin_paths() paths, and provides a concrete language. Then this can be enabled on the UI like any other provider. A bonus for it providing a per-user configuration option as well for admin language. Where it gets tricky is that it would change the content language as well with our current default fallback method in core, so we'd need to expose those settings somehow to let people disconnect content from interface, which is the primary goal of this feature anyway.
Comment #17
plachAs I was writing in #1036212: Use hook_language_types_info() instead of hook_init() in D7, I think the admin language provider is the way to go too: it could set the default admin language using the user setting and falling back to the default admin language.
The provider should be defined to be assignable only to the UI language. To actually take advantage of this we should make content language negotiation enabled by default in D8: node translation, if present, could exploit it through the
tnode/1
feature we were speaking about in the last months.Comment #18
plachtagging
Comment #19
Gábor Hojtsy@plach: it does sound like a usability problem if we need to expose both interface and content language config separately in D8, that does not sound like good news. However, I see that trying to not inherit to content language if it was picked by the admin language one would be a bad case of special casing that we should not pursue. Hm.
Comment #20
Charles BelovThe issue for me is that I am below survival level for both Spanish and Chinese for a trilingual website (with English as the main language and selected content translated). It is also possible we would be adding additional languages for which I know nothing. I may need to post content simply by somebody providing me a Word doc with the translation, and I just copy and paste. I want all interface content to be in English, but the content page would be marked as Spanish or Chinese and show up in Spanish or Chinese.
An anonymous viewer of the Spanish or Chinese page would see everything on the page entirely in that language except, of course, for the other-languages entries in the language-switcher block.
However a logged-in staff content-administering viewer would want to see Drupal interface links such as "Log out," "Edit," "Add new content" and the administrator menu in the logged-in viewer's preferred administration language, not in the content language.
Comment #21
plachThis should be already possible in D7 core: just enable the User language detection method on top of the URL one.
Comment #22
Gábor HojtsyTagging for base language system.
Comment #23
Gábor HojtsyTagging for language negotiation too.
Comment #24
Charles BelovActually, the other languages have just hit and it's likely to affect many U.S. local government transportation websites due to action by the Federal Transportation Administration. As part of U.S. Title VI of the Civil Rights act, the San Francisco Municipal Transportation Agency website is now going to have at least a few pages each in Arabic, French, Japanese, Korean, Italian, Russian, Thai, Vietnamese and possibly Tagalog. I have to be able to copy and paste content in those languages, as well as verify they can be viewed by an anonymous visitor, but manage that content using an English-language interface.
Comment #25
Gábor HojtsyAnybody want to work on this?
Comment #26
c31ck CreditAttribution: c31ck commentedI'll work on this.
Comment #27
c31ck CreditAttribution: c31ck commentedTagging with sprint.
Comment #28
c31ck CreditAttribution: c31ck commentedInitial patch that adds a language provider and allows a user to choose their admin language. Users can choose their admin language if they have the access administration pages permission and if the user admin language provider is enabled.
Comment #30
c31ck CreditAttribution: c31ck commentedAttempt at fixing test failures.
Comment #31
vasi1186 CreditAttribution: vasi1186 commentedThe patch looks pretty good to me, I have a small observation:
The language_negotiation_include() function is implemented by the language module, which is not a required core module, so I think this will generate a fatal error on the sites that have the language module disabled.
After a talk with Gabor, I think a better idea would be to just remove the language_negotiation check from the #access, so then you do not need to include the file anymore. The user_access call should also be called with the user account parameter. Also, you can move the "user_access('access administration pages')" into the #access and then the code will be just more straightforward.
Comment #32
c31ck CreditAttribution: c31ck commentedI've removed the language_negotiation check and moved the user_access into the #access. Also, $account is now passed to user_access.
Comment #33
vasi1186 CreditAttribution: vasi1186 commentedLooks good to me now.
But, I think we now have another issue: the user_preferred_admin_language() function generates code duplication, because the almost exactly same code and comments can be found in user_preferred_language(). One solution would be to juse use the user_preferred_language() in both cases, and add a parameter, so you will end up in having something like:
Then, inside the function, depending on the $type parameter, we will have to use (preferable in the most clever and flexible way) the right attribute. A good approach would be to use the $type parameter in a way that if you will add another type of language in the future, then the code in the user_preferred_language() should not change.
Comment #34
Schnitzel CreditAttribution: Schnitzel commentedComment #35
Schnitzel CreditAttribution: Schnitzel commentedremoved the user_preferred_admin_language() function and added a new parameter for user_preferred_language()
also needs tests!
Comment #36
webflo CreditAttribution: webflo commentedYou changed the parameters for user_preferred_language(). user_preferred_language() is used in a few places in core. I also prefere NULL as default value for $type.
Comment #37
Schnitzel CreditAttribution: Schnitzel commentedchecked the rest of the core, user_preferred_language() is all the time called with 1 parameter, so no issue there.
But the default parameter NULL is a good idea.
Comment #38
Schnitzel CreditAttribution: Schnitzel commenteddiscussed with @webflo and @gabor: that language_from_user_admin() and language_from_user() should check if the preferred language is a valid language. did this now.
also added 6 new tests for testing LANGUAGE_NEGOTIATION_USER_ADMIN and LANGUAGE_NEGOTIATION_USER
Comment #39
Schnitzel CreditAttribution: Schnitzel commentedtags
Comment #40
attiks CreditAttribution: attiks commentedsome missing dots
missing dot
missing dot
missing dot
missing dot at the end
Comment #41
Bojhan CreditAttribution: Bojhan commentedCan this get a screenshot?
Comment #42
Schnitzel CreditAttribution: Schnitzel commentedscreenies
Comment #43
Bojhan CreditAttribution: Bojhan commentedSchnitzel explained it to me, looks like we just need to fix some of the labeling.
http://drupal.org/files/admin%20%7C%20drupal8.jpg
On the account page, we want to remove the description and clarify the label a bit. This because "Admin Language" isn't very clear, people don't know what the "Admin" is. Therefor we suggest changing it to:
"Administration pages language"
This also means that we need to change Language, to "Site Language".
http://drupal.org/files/Languages%20%7C%20drupal8.jpg
Almost all the labels here are overly descriptive, it could probably be something like:
Language from the URL(Path prefix or domain)
Language from the requestion/session paramter
Account language setting.
Language from the browser's language setting.
Account administration pages language setting.
Default site language (English)
We have to figure out whether we want setting or preference, I am not sure what the standard is.
Comment #44
Schnitzel CreditAttribution: Schnitzel commentedfixxed codestyle and textadaptions
Comment #45
attiks CreditAttribution: attiks commentedI find the description a bit odd:
alternatives:
- Site language setting of the user.
- Site language setting of the user's account.
- "Language setting of the user for the administration pages"
- "Administration pages language of the user"
only for authenticated users
Site language (without a capital L)
Comment #46
Schnitzel CreditAttribution: Schnitzel commentedthanks @atticks for the review. Also discussed the change and we both agree that Account is a bit confusing, but overall we say:
- I send a mail to an user
- An user makes changes in is account
So account makes more sense.
so fixxed the capital and "authenticated users"
Comment #47
webflo CreditAttribution: webflo commentedLets rename this negotiation methods in follow-up issue.
Why not just use isset($langauges[$user->preferred_language])?
isset($type) is more accurate.
Comment #48
Schnitzel CreditAttribution: Schnitzel commentedthanks for review, removed the textchanges and using isset()
Comment #49
Schnitzel CreditAttribution: Schnitzel commentedfollow up for texts: #1756122: Better Names and Description for Language Negotiations
Comment #50
webflo CreditAttribution: webflo commentedI found one last issue.
The db schema is not identical. The 'default' key is missing too.
Comment #51
Schnitzel CreditAttribution: Schnitzel commentedthanks! fixed with using the same schema for update and install
Comment #52
webflo CreditAttribution: webflo commentedLooks good now.
Comment #53
attiks CreditAttribution: attiks commentedsorry missed it before
better switch to using new Language()
dito
Comment #54
webflo CreditAttribution: webflo commentedFixed the bugs mentioned by attiks.
Comment #55
Schnitzel CreditAttribution: Schnitzel commentedlooks good, RTBC when green
Comment #56
Schnitzel CreditAttribution: Schnitzel commentedComment #57
webflo CreditAttribution: webflo commentedRebased against 8.x HEAD is much smaller now. Its only one submit handler (language_admin_add_form_submit) for predefined and custom languages.
Comment #58
webflo CreditAttribution: webflo commentedAnd added the more descriptive strings for 46.
Comment #59
Schnitzel CreditAttribution: Schnitzel commentedthe new patch is better now, so RTBC!
Comment #60
penyaskitoRerolled.
Comment #62
penyaskitoDuplicated use?
Comment #63
penyaskitoComment #65
penyaskito#1688144-19: tnid does not updated to zero after node delete maybe related?
Comment #66
webchick#62: admin-user-interface-language-option-322995-62.patch queued for re-testing.
Comment #67
Gábor HojtsyThanks for the rerolls.
Comment #68
Dries CreditAttribution: Dries commentedThis looks good. Committed to 8.x. Thanks.
Comment #69
Gábor HojtsyAdded a site builders' change notice for this at http://drupal.org/node/1776768 - CHANGELOG.txt patch forthcoming from rvilar.
Comment #70
Gábor HojtsyChangelog action happening in #1777870: Catch up changelog.txt with recent languages changes, removing off sprint. Thanks all!
Comment #72
Gábor HojtsyUsability followup: #1833012: Move admin language negotiation up to first option
"Bug" followup: #1833010: Admin user language preference WSOD if ahead of path prefixes
Comment #72.0
Gábor Hojtsyminor grammar changes
Comment #73
penyaskito