Skip to content

Commit d7ac19a

Browse files
authored
Merge branch 'tofi86:master' into master
2 parents 5c85fa7 + cd2d3c3 commit d7ac19a

File tree

5 files changed

+55
-23
lines changed

5 files changed

+55
-23
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [3.3.0] - 2023-02-04
10+
11+
PLEASE NOTE: This is the last official release as I'm going to sunset this project for personal reasons.
12+
13+
### Added
14+
- Support country specific locales such as Brazilian Portuguese (`pt-BR`)
15+
- Translation of messages to Brazilian Portuguese (#115, Thanks to @israelins85 for his contribution)
16+
17+
### Changed
18+
- Changed Adopt OpenJDK link and name to Adoptium
19+
20+
### Removed
21+
- Option to fund this project
22+
23+
924
## [3.2.0] - 2021-02-21
1025
### Added
1126
- Also expand variables `$APP_PACKAGE`, `$JAVAROOT` and `$USER_HOME` in Oracle style PList files

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2021 Tobias Fischer
3+
Copyright (c) 2014-2023 Tobias Fischer
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
universalJavaApplicationStub
22
============================
33

4-
![Tests and Shellcheck](https://github.com/tofi86/universalJavaApplicationStub/workflows/Tests%20and%20Shellcheck/badge.svg) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases) [![Donate to this project using Buy Me A Coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://ko-fi.com/tofi86)
4+
![Tests and Shellcheck](https://github.com/tofi86/universalJavaApplicationStub/workflows/Tests%20and%20Shellcheck/badge.svg) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases)
55

66
A BASH based _launcher stub_ for Java based macOS Apps that works with both Apple's and Oracle's plist format. It is released under the [MIT License](https://github.com/tofi86/universalJavaApplicationStub/blob/master/LICENSE).
77

@@ -11,8 +11,6 @@ A BASH based _launcher stub_ for Java based macOS Apps that works with both Appl
1111

1212
🤔 ❓ If you have a _general question_ about how a feature works or would like to _share an idea_ or a _usecase for this project_, then please use the [GitHub Discussions Page](https://github.com/tofi86/universalJavaApplicationStub/discussions).
1313

14-
❤️ ☕ If you want to support this independent project, you can buy me a coffee: [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/tofi86)
15-
1614

1715
Why
1816
---

src/universalJavaApplicationStub

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
# #
1212
# @author Tobias Fischer #
1313
# @url https://github.com/tofi86/universalJavaApplicationStub #
14-
# @date 2021-02-21 #
15-
# @version 3.2.0 #
14+
# @date 2023-02-04 #
15+
# @version 3.3.0 #
1616
# #
1717
##################################################################################
1818
# #
1919
# The MIT License (MIT) #
2020
# #
21-
# Copyright (c) 2014-2021 Tobias Fischer #
21+
# Copyright (c) 2014-2023 Tobias Fischer #
2222
# #
2323
# Permission is hereby granted, free of charge, to any person obtaining a copy #
2424
# of this software and associated documentation files (the "Software"), to deal #
@@ -360,7 +360,7 @@ done
360360
############################################
361361

362362
# supported languages / available translations
363-
stubLanguages="^(fr|de|zh|es|en)-"
363+
stubLanguages=("de" "en" "es" "fr" "pt-BR" "zh")
364364

365365
# read user preferred languages as defined in macOS System Preferences (#101)
366366
stub_logger '[LanguageSearch] Checking preferred languages in macOS System Preferences...'
@@ -371,15 +371,19 @@ language=""
371371
for i in "${appleLanguages[@]}"
372372
do
373373
langValue="${i%-*}"
374-
if [[ "$i" =~ $stubLanguages ]]; then
375-
stub_logger "[LanguageSearch] ... selected '$i' ('$langValue') as the default language for the launcher stub"
374+
if [[ " ${stubLanguages[*]} " =~ " ${i} " ]]; then
375+
stub_logger "[LanguageSearch] ... selected '$i' as the default language for the launcher stub"
376+
language=${i}
377+
break
378+
elif [[ " ${stubLanguages[*]} " =~ " ${langValue} " ]]; then
379+
stub_logger "[LanguageSearch] ... selected '$langValue' (from '$i') as the default language for the launcher stub"
376380
language=${langValue}
377-
break
381+
break
378382
fi
379383
done
380384
if [ -z "${language}" ]; then
381-
language="en"
382-
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
385+
language="en"
386+
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
383387
fi
384388
stub_logger "[Language] $language"
385389

@@ -398,7 +402,7 @@ fr)
398402
MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
399403
MSG_LATER="Plus tard"
400404
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
401-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
405+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
402406
;;
403407

404408
# German
@@ -414,7 +418,7 @@ de)
414418
MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."
415419
MSG_LATER="Später"
416420
MSG_VISIT_JAVA_DOT_COM="Java von Oracle"
417-
MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"
421+
MSG_VISIT_ADOPTIUM="Java von Adoptium"
418422
;;
419423

420424
# Simplified Chinese
@@ -430,7 +434,7 @@ zh)
430434
MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"
431435
MSG_LATER="稍后"
432436
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
433-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
437+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
434438
;;
435439

436440
# Spanish
@@ -446,9 +450,25 @@ es)
446450
MSG_INSTALL_JAVA="¡Necesita tener JAVA instalado en su Mac!\nVisite java.com para consultar las instrucciones para su instalación..."
447451
MSG_LATER="Más tarde"
448452
MSG_VISIT_JAVA_DOT_COM="Java de Oracle"
449-
MSG_VISIT_ADOPTOPENJDK="Java de AdoptOpenJDK"
453+
MSG_VISIT_ADOPTIUM="Java de Adoptium"
450454
;;
451455

456+
# Brazilian Portuguese
457+
pt-BR)
458+
MSG_ERROR_LAUNCHING="ERRO iniciando '${CFBundleName}'."
459+
MSG_MISSING_MAINCLASS="'MainClass' não foi definida!\nA aplicação java não poderá ser iniciada!"
460+
MSG_JVMVERSION_REQ_INVALID="A sintaxe da versão Java requerida não é valida: %s\nPor favor contacte o desenvolvedor dessa aplicação."
461+
MSG_NO_SUITABLE_JAVA="Não foi encontrado uma versão Java compatível no seu sistema!\nEsta aplicação precisa do Java %s"
462+
MSG_JAVA_VERSION_OR_LATER="ou maior"
463+
MSG_JAVA_VERSION_LATEST="(última atualização)"
464+
MSG_JAVA_VERSION_MAX="máxima %s"
465+
MSG_NO_SUITABLE_JAVA_CHECK="Verifique se instalou a versão Java necessária."
466+
MSG_INSTALL_JAVA="Você precisa instalar o JAVA no seu Mac!\nPor favor, visite java.com para instruções de instalação..."
467+
MSG_LATER="Depois"
468+
MSG_VISIT_JAVA_DOT_COM="Java por Oracle"
469+
MSG_VISIT_ADOPTIUM="Java por Adoptium"
470+
;;
471+
452472
# English | default
453473
en|*)
454474
MSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'."
@@ -462,7 +482,7 @@ en|*)
462482
MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
463483
MSG_LATER="Later"
464484
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
465-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
485+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
466486
;;
467487
esac
468488

@@ -828,21 +848,21 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
828848
stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"
829849

830850
# display error message with AppleScript
831-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
851+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
832852
-e "set response to button returned of the result" \
833853
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
834-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
854+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
835855
# exit with error
836856
exit 3
837857

838858
else
839859
# log exit cause
840860
stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"
841861
# display error message with AppleScript
842-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
862+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
843863
-e "set response to button returned of the result" \
844864
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
845-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
865+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
846866
# exit with error
847867
exit 1
848868
fi

0 commit comments

Comments
 (0)