diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index d17cca506..a332440b7 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -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 diff --git a/Resources/ar.lproj/Localizable.strings b/Resources/ar.lproj/Localizable.strings index 84e769d8e..66fea75f7 100644 Binary files a/Resources/ar.lproj/Localizable.strings and b/Resources/ar.lproj/Localizable.strings differ diff --git a/Resources/de.lproj/Localizable.strings b/Resources/de.lproj/Localizable.strings index d45af878a..a3a93f1ee 100644 Binary files a/Resources/de.lproj/Localizable.strings and b/Resources/de.lproj/Localizable.strings differ diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 363d63fa6..ad0a1f4a3 100644 Binary files a/Resources/en.lproj/Localizable.strings and b/Resources/en.lproj/Localizable.strings differ diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index a53a2440c..94f329f08 100644 Binary files a/Resources/fr.lproj/Localizable.strings and b/Resources/fr.lproj/Localizable.strings differ diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings index 4c88bfe97..98c00b7a7 100644 Binary files a/Resources/ja.lproj/Localizable.strings and b/Resources/ja.lproj/Localizable.strings differ diff --git a/Resources/nl.lproj/Localizable.strings b/Resources/nl.lproj/Localizable.strings index a6a4ce74b..7326dae19 100644 Binary files a/Resources/nl.lproj/Localizable.strings and b/Resources/nl.lproj/Localizable.strings differ diff --git a/Resources/ru.lproj/Localizable.strings b/Resources/ru.lproj/Localizable.strings index bc44093ba..035caa73b 100644 Binary files a/Resources/ru.lproj/Localizable.strings and b/Resources/ru.lproj/Localizable.strings differ diff --git a/Resources/zh_TW.lproj/Localizable.strings b/Resources/zh_TW.lproj/Localizable.strings index db4d2ef95..edbc17b01 100644 Binary files a/Resources/zh_TW.lproj/Localizable.strings and b/Resources/zh_TW.lproj/Localizable.strings differ diff --git a/Tools/i18n_generate_strings_files.sh b/Tools/i18n_generate_strings_files.sh index 4860c5b3e..6c18305cb 100755 --- a/Tools/i18n_generate_strings_files.sh +++ b/Tools/i18n_generate_strings_files.sh @@ -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