trim leading/trailing whitespace from name/summary/video

This should make for predictable layouts, since fastlane entries are likely
to have a tailing newline, but entries in the metadata YAML will not.
This commit is contained in:
Hans-Christoph Steiner 2021-02-06 00:31:31 +01:00
parent 19215db243
commit 57cee93647
2 changed files with 5 additions and 4 deletions

View File

@ -520,17 +520,18 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
if (!TextUtils.isEmpty(value)) {
whatsNew = value;
}
value = getLocalizedEntry(localized, localesToUse, "video");
if (!TextUtils.isEmpty(value)) {
video = value.split("\n", 1)[0];
video = value.trim();
}
value = getLocalizedEntry(localized, localesToUse, "name");
if (!TextUtils.isEmpty(value)) {
name = value;
name = value.trim();
}
value = getLocalizedEntry(localized, localesToUse, "summary");
if (!TextUtils.isEmpty(value)) {
summary = value;
summary = value.trim();
}
value = getLocalizedEntry(localized, localesToUse, "description");
if (!TextUtils.isEmpty(value)) {

View File

@ -29,7 +29,7 @@ public class LocaleSelectionTest {
private static final String KEY = "summary";
private static final String EN_US_NAME = "Checkey: info on local apps\n";
private static final String EN_US_NAME = "Checkey: info on local apps";
private static final String EN_US_FEATURE_GRAPHIC = "en-US/featureGraphic.png";
private static final String EN_US_PHONE_SCREENSHOT = "en-US/phoneScreenshots/First.png";
private static final String EN_US_SEVEN_INCH_SCREENSHOT = "en-US/sevenInchScreenshots/checkey-tablet.png";