revert "push notification: remove IC_MSG and IM_MSG hack in translation which is actually not needed"

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-07 16:55:45 +02:00
parent e71265bf53
commit e4d2900b6c
10 changed files with 20 additions and 5 deletions

View file

@ -702,7 +702,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
data->notification.repeatInterval = 0;
data->notification.alertBody =
[NSString stringWithFormat:NSLocalizedString(@"Incoming call from %@", nil), address];
[NSString stringWithFormat:NSLocalizedString(@"IC_MSG", nil), address];
data->notification.alertAction = NSLocalizedString(@"Answer", nil);
data->notification.userInfo = @{ @"callId" : callId, @"timer" : [NSNumber numberWithInt:1] };
data->notification.applicationIconBadgeNumber = 1;
@ -976,7 +976,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
notif.category = @"incoming_msg";
}
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"Incoming message from %@", nil), address];
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_MSG", nil), address];
notif.alertAction = NSLocalizedString(@"Show", nil);
notif.soundName = @"msg.caf";
notif.userInfo = @{ @"from" : address, @"from_addr" : remote_uri, @"call-id" : callID };
@ -2043,6 +2043,8 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
for (int i = 0; i < [tokenData length]; ++i) {
[tokenString appendFormat:@"%02X", (unsigned int)tokenBuffer[i]];
}
// NSLocalizedString(@"IC_MSG", nil); // Fake for genstrings
// NSLocalizedString(@"IM_MSG", nil); // Fake for genstrings
#ifdef USE_APN_DEV
#define APPMODE_SUFFIX @"dev"
#else

View file

@ -31,11 +31,24 @@ fi
##### 1. Generate Localizable.strings from source files (.m)
function generate_localizable_from_sources {
#WARNING: sed issue "extra characters at the end of g command" means that
#WARNING: in case of sed issue "extra characters at the end of g command", it means that
# we are trying to modify an UTF-16 file which is not supported..
localizable_en=$root_directory/Resources/en.lproj/Localizable.strings
rm -f $localizable_en
find $root_directory/Classes -name '*.m' | xargs genstrings -u -a -o "$(dirname $localizable_en)"
# The 2 only specific cases of the application: since we are length limited for push
# notifications, the ID is not matching the English translation... so we must keep
# the translations!
iconv -f utf-16 -t utf-8 $localizable_en > $localizable_en.tmp
IC_MSG_EN=$(sed -nE 's/"IC_MSG" = "(.*)";/\1/p' $localizable_en.tmp)
IM_MSG_EN=$(sed -nE 's/"IM_MSG" = "(.*)";/\1/p' $localizable_en.tmp)
rm -f $localizable_en $localizable_en.tmp
find $root_directory/Classes -name '*.m' | xargs genstrings -u -a -o $(dirname $localizable_en)
iconv -f utf-16LE -t utf-8 $localizable_en > $localizable_en.tmp
sed -i.bak "s/= \"IC_MSG\";/= \"$IC_MSG_EN\";/" $localizable_en.tmp
sed -i.bak "s/= \"IM_MSG\";/= \"$IM_MSG_EN\";/" $localizable_en.tmp
iconv -f utf-8 -t utf-16LE $localizable_en.tmp > $localizable_en
rm $localizable_en.tmp.bak $localizable_en.tmp
}
##### 2. Generate .strings for all XIB files