i18n: update strings and fix generate_strings_file.sh

This commit is contained in:
Gautier Pelloux-Prayer 2015-06-05 10:45:06 +02:00
parent aedf7bfa4a
commit e086e81515
28 changed files with 20 additions and 19 deletions

View file

@ -51,10 +51,6 @@
- (void)viewDidLoad {
[super viewDidLoad];
[linkLabel setText:NSLocalizedString(@"http://www.linphone.org", nil)];
[licenseLabel setText:NSLocalizedString(@"GNU General Public License V2 ", nil)];
[copyrightLabel setText:NSLocalizedString(@"© 2010 Belledonne Communications ", nil)];
[linkLabel addGestureRecognizer:linkTapGestureRecognizer];

View file

@ -48,14 +48,14 @@
<color key="textColor" red="0.81176471709999998" green="0.29803922770000002" blue="0.16078431900000001" alpha="1" colorSpace="deviceRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Linphone iPhone 1.0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="65" userLabel="linphoneIphoneVersionLabel">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Linphone iPhone 1.0 (placeholder)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="65" userLabel="linphoneIphoneVersionLabel">
<rect key="frame" x="10" y="150" width="300" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.35686275360000003" green="0.3960784376" blue="0.43529412150000002" alpha="1" colorSpace="deviceRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Linphone Core 1.0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="66" userLabel="linphoneCoreVersionLabel">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Linphone Core 1.0 (placeholder)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="66" userLabel="linphoneCoreVersionLabel">
<rect key="frame" x="10" y="172" width="300" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>

View file

@ -417,7 +417,7 @@
} else {
errorMsg=[NSString stringWithFormat:NSLocalizedString(@"Unknown error (%@).", nil), error];
}
NSDictionary* dict = @{@"product_id": productID, @"error_msg": NSLocalizedString(errorMsg, nil)};
NSDictionary* dict = @{@"product_id": productID, @"error_msg": errorMsg};
[self postNotificationforStatus:kIAPPurchaseFailed withDict:dict];
}
}
@ -506,6 +506,6 @@
}
- (void)request:(XMLRPCRequest *)request didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
}
@end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -11,19 +11,24 @@ fi
##### 1. Generate Localizable.strings from source files (.m)
function generate_localizable_from_sources {
#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
# 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!
IC_MSG_EN=$(sed -nE 's/"IC_MSG" = "(.*)";/\1/p' $localizable_en)
IM_MSG_EN=$(sed -nE 's/"IM_MSG" = "(.*)";/\1/p' $localizable_en)
rm -f $localizable_en
find $root_directory/Classes -name '*.m' | xargs genstrings -u -a -o $(dirname $localizable_en)
iconv -f utf-16 -t utf-8 $localizable_en > $localizable_en.tmp
mv $localizable_en.tmp $localizable_en
sed -i.bak "s/= \"IC_MSG\";/= \"$IC_MSG_EN\";/" $localizable_en
sed -i.bak "s/= \"IM_MSG\";/= \"$IM_MSG_EN\";/" $localizable_en
rm $localizable_en.bak
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
@ -36,7 +41,7 @@ function generate_strings_from_xib {
# remove if empty
iconv -f utf-16 -t utf-8 "$stringsfile" > "$to_utf8_file"
if [ ! -s "$to_utf8_file" ]; then
if [ $(stat -f '%z' $to_utf8_file) -le 1 ]; then
echo "$(basename "$stringsfile") is empty, removing"
rm "$stringsfile"
else
@ -84,6 +89,6 @@ source_lang = en
done
}
# generate_localizable_from_sources
# generate_strings_from_xib
generate_localizable_from_sources
generate_strings_from_xib
generate_strings_from_inappsettings_plist