fix(label): ensure the translation kept is not null

This commit is contained in:
Hivert Quentin
2025-09-16 09:59:27 +02:00
parent a7651e56c5
commit 0fb3db0608
2 changed files with 2 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
@class NSArray; @class NSArray;
@class NSString; @class NSString;
@class WOContext; @class WOContext;
@class NSNull;
@interface NSObject (SOGoObjectUtilities) @interface NSObject (SOGoObjectUtilities)

View File

@@ -110,7 +110,7 @@ static NSMutableDictionary *translationCache = nil;
while (!label && (language = [languages nextObject])) while (!label && (language = [languages nextObject]))
{ {
if (![translationCache objectForKey: language]) { if (![translationCache objectForKey: language] || [[translationCache objectForKey: language] objectForKey: key] != [NSNull null]) {
paths = [bundle pathsForResourcesOfType: @"strings" paths = [bundle pathsForResourcesOfType: @"strings"
inDirectory: [NSString stringWithFormat: @"%@.lproj", inDirectory: [NSString stringWithFormat: @"%@.lproj",
language] language]