aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/mac.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-09 00:11:43 +0200
committerMarkus Reiter2016-09-09 20:24:47 +0200
commit0243e1f9a70c6bb1304dacc3abbb0d0d0ca383b2 (patch)
treec3ae31fa38dbfa11092b9272cf2dc9489b4f208d /Library/Homebrew/os/mac.rb
parentf37d004ab5588d7b24a593ad8619f024b8c91a6b (diff)
downloadbrew-0243e1f9a70c6bb1304dacc3abbb0d0d0ca383b2.tar.bz2
Add language method to `OS::Mac`.
Diffstat (limited to 'Library/Homebrew/os/mac.rb')
-rw-r--r--Library/Homebrew/os/mac.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 70cd3e33f..6d5c81182 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -41,6 +41,10 @@ module OS
version.to_sym
end
+ def language
+ @language ||= Utils.popen_read("defaults", "read", ".GlobalPreferences", "AppleLanguages").delete(" \n\"()").sub(/,.*/, "")
+ end
+
# Locates a (working) copy of install_name_tool, guaranteed to function
# whether the user has developer tools installed or not.
def install_name_tool