From 31a3e37c7651b45e01519aa9dd6638df833c4917 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Thu, 21 Nov 2024 09:45:54 +0300 Subject: [PATCH] feat: content language support --- CHANGELOG.md | 2 ++ CountlyContentBuilderInternal.m | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a61dfd3..f314987a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 24.7.8 +* Added support for localization of content blocks. + * Mitigated an issue where visibility could have been wrongly assigned if a view was closed while going to background. (Experimental!) * Mitigated an issue where the user provided URLSessionConfiguration was not applied to direct requests diff --git a/CountlyContentBuilderInternal.m b/CountlyContentBuilderInternal.m index ec0bbcb0..196edb8a 100644 --- a/CountlyContentBuilderInternal.m +++ b/CountlyContentBuilderInternal.m @@ -137,6 +137,11 @@ - (NSURLRequest *)fetchContentsRequest queryString = [CountlyConnectionManager.sharedInstance appendChecksum:queryString]; + NSArray *components = [CountlyDeviceInfo.locale componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"_-"]]; + + queryString = [queryString stringByAppendingFormat:@"&%@=%@", + @"la", components.firstObject]; + NSString* URLString = [NSString stringWithFormat:@"%@%@?%@", CountlyConnectionManager.sharedInstance.host, kCountlyEndpointContent,