Fallback in case SULocalizedStringFromTableInBundle() fails (#2533)

SULocalizedStringFromTableInBundle() should only fail in the abnormal situation where the app bundle may have been moved while it was running. Technically the app is running in an unsupported state but I suppose we can guard against it here.
This commit is contained in:
Zorg authored and GitHub committed 2024-03-28 18:52:28 -07:00
1 parent 9aece0259c
commit 2b7615fe5b
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -169,4 +169,4 @@ GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VARIABLE = YES
// Turn on all warnings, then disable a few which are almost impossible to avoid
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Werror=undef
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef
+2 -1
View File
@@ -17,7 +17,8 @@
#define SPARKLE_TABLE @"Sparkle"
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment)
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) (NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) ?: key)
#else
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) key
#endif