From e4d2900b6cbde44b1e92a24e92996ac1e53277b6 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 7 Oct 2015 16:55:45 +0200 Subject: [PATCH] revert "push notification: remove IC_MSG and IM_MSG hack in translation which is actually not needed" --- Classes/LinphoneManager.m | 6 ++++-- Resources/ar.lproj/Localizable.strings | Bin 33002 -> 32936 bytes Resources/de.lproj/Localizable.strings | Bin 35314 -> 35248 bytes Resources/en.lproj/Localizable.strings | Bin 33814 -> 33748 bytes Resources/fr.lproj/Localizable.strings | Bin 35178 -> 35112 bytes Resources/ja.lproj/Localizable.strings | Bin 30656 -> 30590 bytes Resources/nl.lproj/Localizable.strings | Bin 35082 -> 35016 bytes Resources/ru.lproj/Localizable.strings | Bin 34242 -> 34176 bytes Resources/zh_TW.lproj/Localizable.strings | Bin 33722 -> 33656 bytes Tools/i18n_generate_strings_files.sh | 19 ++++++++++++++++--- 10 files changed, 20 insertions(+), 5 deletions(-) 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 84e769d8ea909b6cfd41453d723302bad94a7de5..66fea75f7b9b8a136fc0f483e723d3ace90215c7 100644 GIT binary patch delta 55 zcmaFW$h4x7X~Q{PPG^RA2499?2KUK~2FjCb4AUl`(>=lI3m1(x?A$yg_X~Q|)$q9NVHt*1X$2eKYP-wDNmDFSzXTHfFbPFagFk}X0 HCS0Kaf(jL8 delta 95 zcmdlmnd#GHrVVQhCVLs)*nG_B0pny26QRi}O;VH1j6^0&x${lVXyTjv!60h#0uwg% wT!u`BJce`z1%_OPREA<8Oa$^$f&4UvB8GgRr~-p3gTrKPqq&)oX!mK489D(4DOQ!O}Zy57{1{2g^R=%OHO`dQn8uK=o#bYI8&Yw E0N0xlG5`Po delta 55 zcmV-70LcHSk^<_I05R)>37?UP* N4wJqzc(WKa5L9-H6#4)F diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings index 4c88bfe975fadb78b8a828c24ff36e0ace19b79b..98c00b7a782b9134866bcea774c6cef96e33e271 100644 GIT binary patch delta 51 zcmX@`p7Gy1#tj>^IGq{d8GIRn8Qdp_>gG@0pmmMY7cTNqw|sMl_8P{`IeH^CTnP4+gziwj&brTU7^VWMN*TGXr)YEqAS3g%aF=Y41|dc=?tlp R`HQ3{3+d!+R?~~{1ON})75D%E diff --git a/Resources/nl.lproj/Localizable.strings b/Resources/nl.lproj/Localizable.strings index a6a4ce74ba4f7e6fef220d6e3acf5de7b06756e2..7326dae19d81dc7ae9b3d6b76b3ec8394b46c2a0 100644 GIT binary patch delta 63 zcmeC0#B^dJ(}qxk*RAE(}qv$3%1{i1i9lW|ke|j-#E=gZRbWtMaF{GsGFZd7na^ZPAON677-9eb delta 47 zcmZqZW;)c(wBeQh=X+wk_r!zx5gD*ocgZt$BhO(0#42vd5=w0LVMG~F9*+Bmibjnw2Ey_U&y3N&y 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