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

Commit cd2d3c3

Browse files
authored
Merge pull request #126 from tofi86/develop
2 parents 8bcbdba + 404f5c1 commit cd2d3c3

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 #
@@ -344,7 +344,7 @@ done
344344
############################################
345345

346346
# supported languages / available translations
347-
stubLanguages="^(fr|de|zh|es|en)-"
347+
stubLanguages=("de" "en" "es" "fr" "pt-BR" "zh")
348348

349349
# read user preferred languages as defined in macOS System Preferences (#101)
350350
stub_logger '[LanguageSearch] Checking preferred languages in macOS System Preferences...'
@@ -355,15 +355,19 @@ language=""
355355
for i in "${appleLanguages[@]}"
356356
do
357357
langValue="${i%-*}"
358-
if [[ "$i" =~ $stubLanguages ]]; then
359-
stub_logger "[LanguageSearch] ... selected '$i' ('$langValue') as the default language for the launcher stub"
358+
if [[ " ${stubLanguages[*]} " =~ " ${i} " ]]; then
359+
stub_logger "[LanguageSearch] ... selected '$i' as the default language for the launcher stub"
360+
language=${i}
361+
break
362+
elif [[ " ${stubLanguages[*]} " =~ " ${langValue} " ]]; then
363+
stub_logger "[LanguageSearch] ... selected '$langValue' (from '$i') as the default language for the launcher stub"
360364
language=${langValue}
361-
break
365+
break
362366
fi
363367
done
364368
if [ -z "${language}" ]; then
365-
language="en"
366-
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
369+
language="en"
370+
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
367371
fi
368372
stub_logger "[Language] $language"
369373

@@ -382,7 +386,7 @@ fr)
382386
MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
383387
MSG_LATER="Plus tard"
384388
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
385-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
389+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
386390
;;
387391

388392
# German
@@ -398,7 +402,7 @@ de)
398402
MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."
399403
MSG_LATER="Später"
400404
MSG_VISIT_JAVA_DOT_COM="Java von Oracle"
401-
MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"
405+
MSG_VISIT_ADOPTIUM="Java von Adoptium"
402406
;;
403407

404408
# Simplified Chinese
@@ -414,7 +418,7 @@ zh)
414418
MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"
415419
MSG_LATER="稍后"
416420
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
417-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
421+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
418422
;;
419423

420424
# Spanish
@@ -430,9 +434,25 @@ es)
430434
MSG_INSTALL_JAVA="¡Necesita tener JAVA instalado en su Mac!\nVisite java.com para consultar las instrucciones para su instalación..."
431435
MSG_LATER="Más tarde"
432436
MSG_VISIT_JAVA_DOT_COM="Java de Oracle"
433-
MSG_VISIT_ADOPTOPENJDK="Java de AdoptOpenJDK"
437+
MSG_VISIT_ADOPTIUM="Java de Adoptium"
434438
;;
435439

440+
# Brazilian Portuguese
441+
pt-BR)
442+
MSG_ERROR_LAUNCHING="ERRO iniciando '${CFBundleName}'."
443+
MSG_MISSING_MAINCLASS="'MainClass' não foi definida!\nA aplicação java não poderá ser iniciada!"
444+
MSG_JVMVERSION_REQ_INVALID="A sintaxe da versão Java requerida não é valida: %s\nPor favor contacte o desenvolvedor dessa aplicação."
445+
MSG_NO_SUITABLE_JAVA="Não foi encontrado uma versão Java compatível no seu sistema!\nEsta aplicação precisa do Java %s"
446+
MSG_JAVA_VERSION_OR_LATER="ou maior"
447+
MSG_JAVA_VERSION_LATEST="(última atualização)"
448+
MSG_JAVA_VERSION_MAX="máxima %s"
449+
MSG_NO_SUITABLE_JAVA_CHECK="Verifique se instalou a versão Java necessária."
450+
MSG_INSTALL_JAVA="Você precisa instalar o JAVA no seu Mac!\nPor favor, visite java.com para instruções de instalação..."
451+
MSG_LATER="Depois"
452+
MSG_VISIT_JAVA_DOT_COM="Java por Oracle"
453+
MSG_VISIT_ADOPTIUM="Java por Adoptium"
454+
;;
455+
436456
# English | default
437457
en|*)
438458
MSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'."
@@ -446,7 +466,7 @@ en|*)
446466
MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
447467
MSG_LATER="Later"
448468
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
449-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
469+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
450470
;;
451471
esac
452472

@@ -812,21 +832,21 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
812832
stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"
813833

814834
# display error message with AppleScript
815-
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}" \
835+
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}" \
816836
-e "set response to button returned of the result" \
817837
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
818-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
838+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
819839
# exit with error
820840
exit 3
821841

822842
else
823843
# log exit cause
824844
stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"
825845
# display error message with AppleScript
826-
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}" \
846+
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}" \
827847
-e "set response to button returned of the result" \
828848
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
829-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
849+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
830850
# exit with error
831851
exit 1
832852
fi

0 commit comments

Comments
 (0)