diff --git a/src/nls-global.mk b/src/nls-global.mk
index 73a6db10a1d..b33e25ad9a4 100644
--- a/src/nls-global.mk
+++ b/src/nls-global.mk
@@ -123,8 +123,22 @@ ifneq (,$(LANGUAGES))
 	done
 endif
 
+# On Solaris, we must make locale-named symlinks for each language directory,
+# else Sun's gettext implementation won't find the messages.  But we only
+# bother for UTF-8 locales, since our .mo files are in UTF-8 and Sun's gettext
+# can't do transcoding.  (With Sun's sh, the final "exit 0" is required to
+# prevent failure in case of the last grep invocation finding nothing.)
 installdirs-po:
-	$(if $(LANGUAGES),$(MKDIR_P) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES),:)
+ifneq (,$(LANGUAGES))
+	$(MKDIR_P) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES)
+ifeq ($(PORTNAME), solaris)
+	cd '$(DESTDIR)$(localedir)' && for lang in $(LANGUAGES); do \
+	  for locale in `locale -a | grep "^$${lang}_.*UTF-8"`; do \
+	    rm -f "$$locale" && $(LN_S) $$lang "$$locale" || exit 1; \
+	  done ; \
+	done ; exit 0
+endif
+endif
 
 uninstall-po:
 	$(if $(LANGUAGES),rm -f $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo),:)
