Way to find out which Office 2011 language is installed?

bmgsupport
New Contributor II

Hey, we are using Office 2011 for Mac in our environment. I wasnt able to find a multi language dmg file so I am struggeling around to find a way how to check remotely what Office language is installed in order to get the right updates assigned to the respective Mac.

Do you have any suggestions?

Thanks in advance
Thomas

2 REPLIES 2

bmgsupport
New Contributor II

I think a found a solution myself. There is a post on Jamf where it states to use a PLIST entry but this returns EN, even if spanish language is installed.

I am now checking for an existing folder which contains a two letter country code of the installed version, put into a script, added it as an extension attribute and used it for a smart group. For some reason Microsoft is not using the ISO 3166-1 alpha-2 two letter country code so you might need to verify which language code fits to your actual language. (e.g. Swedish is not SE but SV)

#!/bin/sh

if [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/es.lproj/" ] ; then
    LANGUAGE=es
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/de.lproj/" ] ; then
    LANGUAGE=de
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/cn.lproj/" ] ; then
    LANGUAGE=de
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/en.lproj/" ] ; then
    LANGUAGE=en
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/fr.lproj/" ] ; then
    LANGUAGE=fr
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/it.lproj/" ] ; then
    LANGUAGE=it
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/nl.lproj/" ] ; then
    LANGUAGE=nl
elif [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/sv.lproj/" ] ; then
    LANGUAGE=sv
else
    LANGUAGE="Not installed (Folder does not exist)"
fi

echo "<result>$LANGUAGE</result>"

mm2270
Legendary Contributor III

Something tells me there is a better way to get this information, but then, I looked at some of the Office plists and I'm not seeing anything anywhere where the installed language is listed. So I'm at a loss to provide any kind of more "proper" way to pull this info.

I can offer the following though. If you're going to script it, you may want to try the following instead.

#!/bin/bash

if [ -d "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources" ]; then
    LANGPATH=$(find "/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources" -name *.lproj)
    if [ "$LANGPATH" ]; then
        LANG=$(echo "${LANGPATH##*/}" | cut -d. -f1)

        echo "<result>$LANG</result>"
    else
        echo "<result>Not Installed</result>"
    fi
else
    echo "<result>Application Not Found</result>"
fi

It locates any .lproj folder inside the Resources directory, and extracts the name minus the .lproj part, and uses that as the result to echo back.

So in my case, it returns "en" since the en.lproj directory is the only one in "Resources" and it takes that and removes the .lproj extension from the string.
I'm not certain if you'd run into problems like if there was more than one .lproj directory though. Does that even happen?

Hope that helps.