summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Luby <patrick.luby@collabora.com>2023-04-17 14:26:24 -0400
committerPatrick Luby <patrick.luby@collabora.com>2023-04-17 14:26:24 -0400
commit3ef4ef90b95345612fb98e161b2d0422d4db7a9e (patch)
tree7add2e37cc9e606c380d7b9143fa5b22082736eb
parentFix debug build breakage due to undefined DEBUG_ABSSRCDIR macro on iOS (diff)
downloadonline-ios-master-debug-build-broken-fix.tar.gz
online-ios-master-debug-build-broken-fix.zip
Fix assert failure when running "My Mac (Designed for iPad)" in Xcode ios-master-debug-build-broken-fix
LANG values such as en_US.UTF-8 trigger an assert in the LibreOffice code so replace all "_" characters with "-" characters. Signed-off-by: Patrick Luby <patrick.luby@collabora.com> Change-Id: Ic28a5dd0ebea9500ac39ced8f6054673e0e68b16
-rw-r--r--ios/Mobile/AppDelegate.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 586426b3a2..ab32bdb639 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -231,8 +231,11 @@ static void updateTemplates(NSData *data, NSURLResponse *response)
// language, as it might be hard to find the way to set it back to a known language.
char *lang = std::getenv("LANG");
+ // Fix assert failure when running "My Mac (Designed for iPad)" in Xcode
+ // LANG values such as en_US.UTF-8 trigger an assert in the LibreOffice
+ // code so replace all "_" characters with "-" characters.
if (lang != nullptr)
- app_locale = [NSString stringWithUTF8String:lang];
+ app_locale = [[NSString stringWithUTF8String:lang] stringByReplacingOccurrencesOfString:@"_" withString:@"-"];
else
app_locale = [[NSLocale preferredLanguages] firstObject];