1#!/bin/sh 2 3language=$(locale -l) 4# The locale can be a single 2 char language or in severall segments like en, se_SE or sr_Latn_ME 5# this tries to get the 2 char language code from longer locales as a fallback 6languageBase=$(echo $language | awk -F_ '{print $1}') 7welcomeURL="\ 8 https://www.haiku-os.org/docs/welcome/welcome_en.html" 9welcomeFile=/boot/system/documentation/welcome/welcome_en.html 10localizedWelcomeFile=/boot/system/documentation/welcome/welcome_"$language".html 11localizedWelcomeFileBase=/boot/system/documentation/welcome/welcome_"$languageBase".html 12 13if [ -f $localizedWelcomeFile ]; then 14 open file:$localizedWelcomeFile 15elif [ -f $localizedWelcomeFileBase ]; then 16 open file:$localizedWelcomeFileBase 17elif [ -f $welcomeFile ]; then 18 open $welcomeFile 19else 20 open $welcomeURL 21fi 22 23