Skip to content

Commit 5772626

Browse files
authored
Merge pull request #3496 from woocommerce/fix/5.8-metadata
Fix 5.8 metadata
2 parents 24c0757 + 5005bbb commit 5772626

File tree

94 files changed

+101
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+101
-45
lines changed

fastlane/Deliverfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@
99
# The Bundle Identifier in App Store Connect
1010
app_identifier "com.automattic.woocommerce"
1111

12-
1312
# This folder has to include one folder for each language
1413
screenshots_path "./fastlane/promo_screenshots/"
1514

1615
# Make sure to update these keys for a new version
1716
app_version "5.8"
1817

19-
privacy_url({
20-
'default' => 'https://automattic.com/privacy/',
21-
})
22-
2318
team_id "299112"
2419

25-
copyright('2021 WooCommerce')
26-
2720
skip_binary_upload true
2821
overwrite_screenshots true
2922
phased_release true

fastlane/download_metadata.swift

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func downloadTranslation(languageCode: String, folderName: String) {
6868

6969
jsonDict.forEach({ (key: String, value: Any) in
7070

71-
guard let index = key.index(of: Character(UnicodeScalar(0004))) else {
71+
guard let index = key.firstIndex(of: Character(UnicodeScalar(0004))) else {
7272
return
7373
}
7474

@@ -105,22 +105,20 @@ func downloadTranslation(languageCode: String, folderName: String) {
105105
let fileManager = FileManager.default
106106
try? fileManager.createDirectory(atPath: languageFolder, withIntermediateDirectories: true, attributes: nil)
107107

108-
/// This sort of hack-ey – we're not actually downloading anything here, but the idea is
109-
/// to keep all of the metadata generation code in the same place. By keeping this in the
110-
/// same file, it should be easier to find, and update if necessary.
111-
let marketingURL = "https://woocommerce.com/mobile/"
112108

113109
do {
110+
let releaseNotesPath = "\(languageFolder)/release_notes.txt"
111+
112+
/// Remove existing release notes in case they weren't translated for this release (that way `deliver` will fall back to the `default` locale)
113+
if FileManager.default.fileExists(atPath: releaseNotesPath) {
114+
try FileManager.default.removeItem(at: URL(fileURLWithPath: releaseNotesPath))
115+
}
116+
114117
try subtitle?.write(toFile: "\(languageFolder)/subtitle.txt", atomically: true, encoding: .utf8)
115-
try whatsNew?.write(toFile: "\(languageFolder)/release_notes.txt", atomically: true, encoding: .utf8)
118+
try whatsNew?.write(toFile: releaseNotesPath, atomically: true, encoding: .utf8)
116119
try keywords?.write(toFile: "\(languageFolder)/keywords.txt", atomically: true, encoding: .utf8)
117120
try storeDescription?.write(toFile: "\(languageFolder)/description.txt", atomically: true, encoding: .utf8)
118121
try promoText?.write(toFile: "\(languageFolder)/promotional_text.txt", atomically: true, encoding: .utf8)
119-
120-
// Don't add the marketing URL unless there's other metadata that's been downloaded
121-
if try fileManager.contentsOfDirectory(atPath: languageFolder).count > 0 {
122-
try marketingURL.write(toFile: "\(languageFolder)/marketing_url.txt", atomically: true, encoding: .utf8)
123-
}
124122
} catch {
125123
print(" Error writing: \(error)")
126124
}
@@ -130,16 +128,6 @@ func downloadTranslation(languageCode: String, folderName: String) {
130128
sema.wait()
131129
}
132130

133-
func deleteExistingMetadata() {
134-
let fileManager = FileManager.default
135-
let url = URL(fileURLWithPath: baseFolder, isDirectory: true)
136-
try? fileManager.removeItem(at: url)
137-
try? fileManager.createDirectory(at: url, withIntermediateDirectories: false)
138-
}
139-
140-
141-
deleteExistingMetadata()
142-
143131
languages.forEach( { (key: String, value: String) in
144132
downloadTranslation(languageCode: value, folderName: key)
145133
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://woocommerce.com/mobile/
1+
https://woocommerce.com/mobile/

fastlane/metadata/ar-SA/name.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WooCommerce
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://automattic.com/privacy/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://docs.woocommerce.com

fastlane/metadata/copyright.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021 WooCommerce
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://woocommerce.com/mobile/
1+
https://woocommerce.com/mobile/

0 commit comments

Comments
 (0)