Skip to content

Commit

Permalink
Fallback in case SULocalizedStringFromTableInBundle() fails
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zorgiepoo committed Mar 28, 2024
1 parent 8c7476f commit 5e2dc68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Configurations/ConfigCommon.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion Sparkle/SULocalizations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e2dc68

Please sign in to comment.