Skip to content

Commit

Permalink
Updates to several things to improve the ability to screenshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
astralbodies committed Feb 28, 2017
1 parent 9cc83b4 commit 49d3c54
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 117 deletions.
36 changes: 18 additions & 18 deletions Scripts/fastlane/Deliverfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@ screenshots_path "./screenshots/"
app_identifier "org.wordpress"

# Make sure to update these keys for a new version
version "4.9"
glotpress_whats_new_key = "v4.9-whats-new"
app_version "7.0"
glotpress_whats_new_key = "v7.0-whats-new"

changelog({
release_notes({
"en-US" => WordPressTranslationRetrieval.get_version_text("en-US", glotpress_whats_new_key),
"en-CA" => WordPressTranslationRetrieval.get_version_text("en-CA", glotpress_whats_new_key),
"en-AU" => WordPressTranslationRetrieval.get_version_text("en-AU", glotpress_whats_new_key),
"es-ES" => WordPressTranslationRetrieval.get_version_text("es-ES", glotpress_whats_new_key),
"fr-FR" => WordPressTranslationRetrieval.get_version_text("fr-FR", glotpress_whats_new_key),
"it-IT" => WordPressTranslationRetrieval.get_version_text("it-IT", glotpress_whats_new_key),
"ja-JP" => WordPressTranslationRetrieval.get_version_text("ja-JP", glotpress_whats_new_key),
"sv-SE" => WordPressTranslationRetrieval.get_version_text("sv-SE", glotpress_whats_new_key),
"it" => WordPressTranslationRetrieval.get_version_text("it", glotpress_whats_new_key),
"ja" => WordPressTranslationRetrieval.get_version_text("ja", glotpress_whats_new_key),
"sv" => WordPressTranslationRetrieval.get_version_text("sv", glotpress_whats_new_key),
"pt-BR" => WordPressTranslationRetrieval.get_version_text("pt-BR", glotpress_whats_new_key),
"nl-NL" => WordPressTranslationRetrieval.get_version_text("nl-NL", glotpress_whats_new_key),
"nl" => WordPressTranslationRetrieval.get_version_text("nl", glotpress_whats_new_key),
"de-DE" => WordPressTranslationRetrieval.get_version_text("de-DE", glotpress_whats_new_key),
"id-ID" => WordPressTranslationRetrieval.get_version_text("id-ID", glotpress_whats_new_key),
"ko-KR" => WordPressTranslationRetrieval.get_version_text("ko-KR", glotpress_whats_new_key),
"ru-RU" => WordPressTranslationRetrieval.get_version_text("ru-RU", glotpress_whats_new_key),
"cmn-Hans" => WordPressTranslationRetrieval.get_version_text("cmn-Hans", glotpress_whats_new_key),
"th-TH" => WordPressTranslationRetrieval.get_version_text("th-TH", glotpress_whats_new_key),
"cmn-Hant" => WordPressTranslationRetrieval.get_version_text("cmn-Hant", glotpress_whats_new_key),
"tr-TR" => WordPressTranslationRetrieval.get_version_text("tr-TR", glotpress_whats_new_key),
"id" => WordPressTranslationRetrieval.get_version_text("id", glotpress_whats_new_key),
"ko" => WordPressTranslationRetrieval.get_version_text("ko", glotpress_whats_new_key),
"ru" => WordPressTranslationRetrieval.get_version_text("ru", glotpress_whats_new_key),
"zh-Hans" => WordPressTranslationRetrieval.get_version_text("zh-Hans", glotpress_whats_new_key),
"th" => WordPressTranslationRetrieval.get_version_text("th", glotpress_whats_new_key),
"zh-Hant" => WordPressTranslationRetrieval.get_version_text("zh-Hant", glotpress_whats_new_key),
"tr" => WordPressTranslationRetrieval.get_version_text("tr", glotpress_whats_new_key),
"en-GB" => WordPressTranslationRetrieval.get_version_text("en-GB", glotpress_whats_new_key),
})

# version '1.2' # you can pass this if you want to verify the version number with the ipa file

config_json_folder './deliver'
# config_json_folder './deliver'

########################################
# Building and Testing
Expand All @@ -60,7 +60,7 @@ config_json_folder './deliver'
# If you only want to upload app metadata, remove the complete ipa block.

# system("ipa build --verbose") # build your project using Shenzhen
"./WordPress-Deliver-iOS.ipa" # Tell 'Deliver' where it can find the finished ipa file
# "./WordPress-Deliver-iOS.ipa" # Tell 'Deliver' where it can find the finished ipa file
# end

# ipa "./latest.ipa" # this can be used instead of the `do` block, if you prefer manually building the ipa file
Expand All @@ -75,6 +75,6 @@ config_json_folder './deliver'
# system("xctool test")
# end

success do
# success do
# system("say 'Successfully deployed a new version.'")
end
# end
15 changes: 8 additions & 7 deletions Scripts/fastlane/Snapfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@

# A list of devices you want to take the screenshots from
devices([
"iPhone 6",
"iPhone 6 Plus",
"iPhone 5",
"iPhone 4s",
"iPad Air"
# "iPhone 7",
# "iPhone 7 Plus",
# "iPhone 5",
"iPad Pro (12.9-inch)"
])

languages("en-US en-CA en-AU es-ES fr-FR it-IT ja-JP sv-SE pt-BR nl-NL de-DE id-ID ko-KR ru-RU cmn-Hans th-TH cmn-Hant tr-TR en-GB".split(" "))
languages("fr-FR es-ES en-US en-CA en-AU it-IT ja-JP sv-SE pt-BR nl-NL de-DE id-ID ko-KR ru-RU cmn-Hans th-TH cmn-Hant tr-TR en-GB".split(" "))

# Where should the resulting screenshots be stored?
output_directory "./screenshots"

scheme "WordPressScreenshotGeneration"

# clear_previous_screenshots # remove the '#'' to clear all previously generated screenshots before creating new ones
# clear_previous_screenshots true # remove the '#'' to clear all previously generated screenshots before creating new ones

# Where is your project (or workspace)? Provide the full path here
workspace "../../WordPress.xcworkspace"

localize_simulator true

# By default, the latest version should be used automatically. If you want to change it, do it here
# ios_version '8.1'

Expand Down
26 changes: 13 additions & 13 deletions Scripts/fastlane/wordpress_translation_retrieval.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ class WordPressTranslationRetrieval
'es-ES' => 'es',
'en-GB' => 'en-gb',
'fr-FR' => 'fr',
'it-IT' => 'it',
'ja-JP' => 'ja',
'sv-SE' => 'sv',
'it' => 'it',
'ja' => 'ja',
'sv' => 'sv',
'pt-BR' => 'pt-br',
'nl-NL' => 'nl',
'nl' => 'nl',
'de-DE' => 'de',
'id-ID' => 'id',
'ko-KR' => 'ko',
'ru-RU' => 'ru',
'cmn-Hant' => 'zh-tw',
'th-TH' => 'th',
'cmn-Hans' => 'zh-cn',
'tr-TR' => 'tr',
'id' => 'id',
'ko' => 'ko',
'ru' => 'ru',
'zh-Hant' => 'zh-tw',
'th' => 'th',
'zh-Hans' => 'zh-cn',
'tr' => 'tr',
}

class << self
Expand Down Expand Up @@ -50,7 +50,7 @@ def retrieve_file_contents_from_glotpress(glotpress_language_code)
url = "https://translate.wordpress.org/projects/apps/ios/release-notes/#{glotpress_language_code}/default/export-translations?format=po"
system "curl -so temp.po #{url}"
file_contents = File.readlines("temp.po")
system "rm temp.po"
# system "rm temp.po"

file_contents
end
Expand All @@ -74,7 +74,7 @@ def get_version_text(deliver_language_code, strings_file_key)
# Uncomment below and run the script from the command line to test
# WordPressTranslationRetrieval::LANGS.each do |deliver_language_code, glotpress_language_code|
# puts "Version text for #{deliver_language_code}"
# puts WordPressTranslationRetrieval.get_version_text(deliver_language_code, "v4.8-whats-new")
# puts WordPressTranslationRetrieval.get_version_text(deliver_language_code, "v7.0-whats-new")
# puts "\n"
# end

Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ import WordPressShared
///
func localizeControls() {
emailTextField.placeholder = NSLocalizedString("Email or username", comment: "Placeholder for a textfield. The user may enter their email address or their username.")
emailTextField.accessibilityIdentifier = "Email or username"

let submitButtonTitle = NSLocalizedString("Next", comment: "Title of a button. The text should be uppercase.").localizedUppercase
submitButton.setTitle(submitButtonTitle, for: UIControlState())
submitButton.setTitle(submitButtonTitle, for: .highlighted)
submitButton.accessibilityIdentifier = "Next Button"

let safariButtonTitle = NSLocalizedString("Log in with Safari saved password", comment: "`Safari saved password` is the name of the iOS feature for saving a password for the Safari browser to use later.")
safariPasswordButton.setTitle(safariButtonTitle, for: UIControlState())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ import WordPressShared
///
func localizeControls() {
usernameField.placeholder = NSLocalizedString("Email or username", comment: "Username placeholder")
usernameField.accessibilityIdentifier = "Email or username"
passwordField.placeholder = NSLocalizedString("Password", comment: "Password placeholder")
passwordField.accessibilityIdentifier = "Password"

let submitButtonTitle = NSLocalizedString("Log In", comment: "Title of a button. The text should be uppercase.").localizedUppercase
submitButton.setTitle(submitButtonTitle, for: UIControlState())
submitButton.setTitle(submitButtonTitle, for: .highlighted)
submitButton.accessibilityIdentifier = "Log In Button"

let forgotPasswordTitle = NSLocalizedString("Lost your password?", comment: "Title of a button. ")
forgotPasswordButton.setTitle(forgotPasswordTitle, for: UIControlState())
Expand Down
2 changes: 2 additions & 0 deletions WordPress/Classes/ViewRelated/Post/WPPostViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ - (UIBarButtonItem*)cancelChevronButton
cancelButton.rightSpacing = RightSpacingOnExitNavbarButton;

UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:cancelButton];
button.accessibilityIdentifier = @"Cancel";
button.accessibilityLabel = NSLocalizedString(@"Cancel", @"Action button to close editor and cancel changes or insertion of post");
_cancelChevronButton = button;
return _cancelChevronButton;
Expand All @@ -1120,6 +1121,7 @@ - (UIBarButtonItem*)cancelXButton

UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:cancelButton];
_cancelXButton = button;
button.accessibilityIdentifier = @"Cancel";
button.accessibilityLabel = NSLocalizedString(@"Cancel", @"Action button to close edior and cancel changes or insertion of post");
return _cancelXButton;
}
Expand Down
7 changes: 5 additions & 2 deletions WordPress/Classes/ViewRelated/System/WPTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ - (UINavigationController *)blogListNavigationController
_blogListNavigationController.tabBarItem.image = [mySitesTabBarImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_blogListNavigationController.tabBarItem.selectedImage = mySitesTabBarImage;
_blogListNavigationController.restorationIdentifier = WPBlogListNavigationRestorationID;
_blogListNavigationController.tabBarItem.accessibilityIdentifier = @"My Sites";
_blogListNavigationController.tabBarItem.accessibilityLabel = NSLocalizedString(@"My Sites", @"The accessibility value of the my sites tab.");
_blogListNavigationController.tabBarItem.title = NSLocalizedString(@"My Sites", @"The accessibility value of the my sites tab.");

Expand All @@ -225,7 +226,7 @@ - (UINavigationController *)readerNavigationController
_readerNavigationController.tabBarItem.image = [readerTabBarImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_readerNavigationController.tabBarItem.selectedImage = readerTabBarImage;
_readerNavigationController.restorationIdentifier = WPReaderNavigationRestorationID;
_readerNavigationController.tabBarItem.accessibilityIdentifier = NSLocalizedString(@"Reader", @"The accessibility value of the Reader tab.");
_readerNavigationController.tabBarItem.accessibilityIdentifier = @"Reader";
_readerNavigationController.tabBarItem.title = NSLocalizedString(@"Reader", @"The accessibility value of the Reader tab.");
}

Expand All @@ -252,7 +253,7 @@ - (UIViewController *)newPostViewController
_newPostViewController = [[UIViewController alloc] init];
_newPostViewController.tabBarItem.image = newPostImage;
_newPostViewController.tabBarItem.imageInsets = [self tabBarIconImageInsets];
_newPostViewController.tabBarItem.accessibilityIdentifier = NSLocalizedString(@"New Post", @"The accessibility value of the post tab.");
_newPostViewController.tabBarItem.accessibilityIdentifier = @"New Post";
_newPostViewController.tabBarItem.title = NSLocalizedString(@"New Post", @"The accessibility value of the post tab.");
_newPostViewController.tabBarItem.titlePositionAdjustment = UIOffsetMake(0, 20.0);

Expand All @@ -267,6 +268,7 @@ - (UINavigationController *)meNavigationController
_meNavigationController.tabBarItem.image = [meTabBarImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_meNavigationController.tabBarItem.selectedImage = meTabBarImage;
_meNavigationController.restorationIdentifier = WPMeNavigationRestorationID;
_meNavigationController.tabBarItem.accessibilityIdentifier = @"Me";
_meNavigationController.tabBarItem.accessibilityLabel = NSLocalizedString(@"Me", @"The accessibility value of the me tab.");
_meNavigationController.tabBarItem.title = NSLocalizedString(@"Me", @"The accessibility value of the me tab.");
}
Expand Down Expand Up @@ -296,6 +298,7 @@ - (UINavigationController *)notificationsNavigationController
_notificationsNavigationController.tabBarItem.image = [notificationsTabBarImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_notificationsNavigationController.tabBarItem.selectedImage = notificationsTabBarImage;
_notificationsNavigationController.restorationIdentifier = WPNotificationsNavigationRestorationID;
_notificationsNavigationController.tabBarItem.accessibilityIdentifier = @"Notifications";
_notificationsNavigationController.tabBarItem.accessibilityLabel = NSLocalizedString(@"Notifications", @"Notifications tab bar item accessibility label");
_notificationsNavigationController.tabBarItem.title = NSLocalizedString(@"Notifications", @"Notifications tab bar item accessibility label");

Expand Down
12 changes: 5 additions & 7 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@
E1C3C8551CE4684800D5DB36 /* EmailTypoCheckerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C3C8541CE4684800D5DB36 /* EmailTypoCheckerTests.swift */; };
E1C5457E1C6B962D001CEB0E /* MediaSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C5457D1C6B962D001CEB0E /* MediaSettings.swift */; };
E1C545801C6C79BB001CEB0E /* MediaSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C5457F1C6C79BB001CEB0E /* MediaSettingsTests.swift */; };
E1C5B2111E54C28C00052319 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E1C5B2131E54C28C00052319 /* Localizable.strings */; };
E1C9AA511C10419200732665 /* Math.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C9AA501C10419200732665 /* Math.swift */; };
E1C9AA561C10427100732665 /* MathTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C9AA551C10427100732665 /* MathTest.swift */; };
E1CFC1571E0AC8FF001DF9E9 /* Pattern.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1CFC1561E0AC8FF001DF9E9 /* Pattern.swift */; };
Expand Down Expand Up @@ -5327,7 +5326,7 @@
};
8511CFB51C607A7000B7CEED = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0820;
TestTargetID = 1D6058900D05DD3D006BFB54;
};
932225A61C7CE50300443B02 = {
Expand Down Expand Up @@ -5481,7 +5480,6 @@
85ED988817DFA00000090D0B /* Images.xcassets in Resources */,
E149771A1C0DCB6F0057CD60 /* MediaSizeSliderCell.xib in Resources */,
E65219F91B8D10C2000B1217 /* ReaderBlockedSiteCell.xib in Resources */,
E1C5B2111E54C28C00052319 /* Localizable.strings in Resources */,
E6D2E15F1B8A9C830000ED14 /* ReaderSiteStreamHeader.xib in Resources */,
B5C66B7A1ACF074600F68370 /* NoteBlockUserTableViewCell.xib in Resources */,
E6D2E1631B8AAA340000ED14 /* ReaderListStreamHeader.xib in Resources */,
Expand Down Expand Up @@ -7106,7 +7104,7 @@
PROVISIONING_PROFILE = "e2604f41-a7ef-448b-8fd9-5c48031085b8";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressScreenshotGeneration/WordPressScreenshotGeneration-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WordPress;
USES_XCTRUNNER = YES;
};
Expand Down Expand Up @@ -7150,7 +7148,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e2604f41-a7ef-448b-8fd9-5c48031085b8";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressScreenshotGeneration/WordPressScreenshotGeneration-Bridging-Header.h";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WordPress;
USES_XCTRUNNER = YES;
};
Expand Down Expand Up @@ -7194,7 +7192,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e2604f41-a7ef-448b-8fd9-5c48031085b8";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressScreenshotGeneration/WordPressScreenshotGeneration-Bridging-Header.h";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WordPress;
USES_XCTRUNNER = YES;
};
Expand Down Expand Up @@ -7239,7 +7237,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e2604f41-a7ef-448b-8fd9-5c48031085b8";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressScreenshotGeneration/WordPressScreenshotGeneration-Bridging-Header.h";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = WordPress;
USES_XCTRUNNER = YES;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
language = "en">
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
Loading

0 comments on commit 49d3c54

Please sign in to comment.