Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 8c0f1db

Browse files
committed
Adapt new localization feature (#30,#27) to new Java version format (#28)
1 parent 9215272 commit 8c0f1db

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/universalJavaApplicationStub

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,27 @@ fi
241241
############################################
242242

243243
LANG=`defaults read -g AppleLocale`
244+
245+
# French localization
244246
if [[ $LANG == fr* ]] ; then
245247
MSG_ERROR_LAUNCHING="Erreur au lancement de '${CFBundleName}'."
246248
MSG_MISSING_MAINCLASS="'MainClass' n'est pas spécifié.\nL'application Java ne peut pas être lancée."
247-
MSG_NO_SUITABLE_JAVA="La version de Java installée sur votre système ne convient pas.\nCe programme nécessite Java ${JVMVersion}.\nMerci de bien vouloir installer la version de Java requise."
249+
MSG_NO_SUITABLE_JAVA="La version de Java installée sur votre système ne convient pas.\nCe programme nécessite Java"
250+
MSG_JAVA_VERSION_OR_LATER="ou plus tard"
251+
MSG_JAVA_VERSION_LATEST="(dernière mise à jour)"
252+
MSG_NO_SUITABLE_JAVA_CHECK="Merci de bien vouloir installer la version de Java requise."
248253
MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
249254
MSG_LATER="Plus tard"
250255
MSG_VISIT_JAVA_DOT_COM="Visiter java.com"
256+
257+
# English default localization
251258
else
252259
MSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'."
253260
MSG_MISSING_MAINCLASS="'MainClass' isn't specified!\nJava application cannot be started!"
254-
MSG_NO_SUITABLE_JAVA="No suitable Java version found on your system!\nThis program requires Java ${JVMVersion}\nMake sure you install the required Java version."
261+
MSG_NO_SUITABLE_JAVA="No suitable Java version found on your system!\nThis program requires Java"
262+
MSG_JAVA_VERSION_OR_LATER="or later"
263+
MSG_JAVA_VERSION_LATEST="(latest update)"
264+
MSG_NO_SUITABLE_JAVA_CHECK="Make sure you install the required Java version."
255265
MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
256266
MSG_LATER="Later"
257267
MSG_VISIT_JAVA_DOT_COM="Visit java.com"
@@ -342,9 +352,9 @@ elif [ ! -z ${JVMVersion} ] ; then
342352

343353
else
344354
# display human readable java version (#28)
345-
java_version_hr=`echo ${JVMVersion} | sed -E 's/[0-9]\.([0-9+*]+)/\1/g' | sed 's/+/ or later/' | sed 's/*/ (latest update)/'`
355+
java_version_hr=`echo ${JVMVersion} | sed -E 's/[0-9]\.([0-9+*]+)/ \1/g' | sed "s/+/ ${MSG_JAVA_VERSION_OR_LATER}/" | sed "s/*/ ${MSG_JAVA_VERSION_LATEST}/"`
346356
# display error message with applescript
347-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" \
357+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA}${java_version_hr}.\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" \
348358
-e "set response to button returned of the result" \
349359
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"http://java.com\""
350360
# exit with error

0 commit comments

Comments
 (0)