Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
language system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jun 2013 at 01:53 UTC
Updated:
29 Jul 2014 at 22:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachAnd here it is.
Comment #2
ParisLiakos commentedmakes sense
Comment #3
berdirAgreed. And this is fine to get in.
That said, Drupal::languageManager()->getLanguage(Language::TYPE_INTERFACE) is still quite ugly, among other things because you need a use for Language and we went to great length to avoid that you have to use Drupal in procedural code. Of which we have less and less but still a fair bit and contrib will have a lot.
So, given that we have constants for those anyway, what about introducing helper methods (in a follow-up issue, of course) for those hardcoded types: Drupal::languageManager()->getInterfaceLanguage()?
Comment #4
alexpottCommitted 6012988 and pushed to 8.x. Thanks!
Comment #5
berdirOpened #2020301: Make the $type parameter of LanguageManager::getLanguage() optional to improve DX for that.
Comment #6
gábor hojtsyComment #7.0
(not verified) commentedUpdated issue summary.