#!/usr/bin/env python

import CoreFoundation

# Show the "current locale", which should be the "system language"
# as used by GIMP.
locale = CoreFoundation.CFLocaleCopyCurrent()
print "The default locale used by GIMP is: ", \
       CoreFoundation.CFLocaleGetIdentifier(locale)
print

# Show the preferred languages
print "The preferred languages configured for this system are:"
preferred = CoreFoundation.CFLocaleCopyPreferredLanguages()
for p in preferred:
    print "  ", p
