Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Localization UI Tests #1051

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ee2b9f4
Add a unit test that visits all screens in the Examples test app
aa-stripe Nov 29, 2018
318f1d3
Clean up some unused code, change shipping form test data
aa-stripe Nov 29, 2018
eaffa83
Remove crappy Xcode UI test tokens
aa-stripe Nov 29, 2018
8670e25
Change file name in comment
aa-stripe Nov 29, 2018
30cc38a
STPAddCardViewController strings all covered.
csabol-stripe Dec 14, 2018
5341802
Didn't need those. STPPaymentCardTextField covered
csabol-stripe Dec 14, 2018
b2128b3
Actually now all of STPAddCardViewController is covered
csabol-stripe Dec 14, 2018
893c1c6
STPPaymentMethodsViewController covered.
csabol-stripe Dec 14, 2018
8c9841a
All screens available, just need to visit them.
csabol-stripe Dec 14, 2018
ad2bbd6
Full coverage in tests
csabol-stripe Dec 14, 2018
be680d8
Autoscroll
csabol-stripe Dec 19, 2018
eecfa9a
Starting reverts
csabol-stripe Dec 19, 2018
5882b6b
Revert "Starting reverts"
csabol-stripe Dec 19, 2018
b9688af
Reverts unneeded changes
csabol-stripe Dec 19, 2018
c444be6
Suppress autoscrolling as needed
csabol-stripe Dec 19, 2018
0e02684
Add localizations to LocalizationTester
csabol-stripe Dec 19, 2018
a276eec
Adds screenshot script.
csabol-stripe Feb 6, 2019
6b39815
Updated translations.
csabol-stripe Feb 6, 2019
88c6c3f
Move the script.
csabol-stripe Feb 6, 2019
342b4f9
Permissions
csabol-stripe Feb 7, 2019
cd246b6
Suppress keyboard.
csabol-stripe Feb 7, 2019
2dd45d9
Use correct language codes
csabol-stripe Feb 7, 2019
a5494fd
Updates from review
csabol-stripe Feb 8, 2019
1586497
Merge branch 'master' into aa-stripe/add-localization-tests
csabol-stripe Mar 18, 2019
b4d9005
Pulls latest translations, fixes es-AR script issue.
csabol-stripe Mar 18, 2019
fb061b3
Fixes string file encoding. Payment method -> payment options
csabol-stripe Mar 18, 2019
2961ea0
Update reference snapshots for new translations
csabol-stripe Mar 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions LocalizationTester/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ @interface AppDelegate ()

@implementation AppDelegate

- (void)_keyboardDidShowNotification {
[((UINavigationController *)self.window.rootViewController).topViewController.view endEditing:YES];
}

- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions {

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_keyboardDidShowNotification) name:UIKeyboardDidShowNotification object:nil];

UIViewController *rootVC = [[ViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootVC];
UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
Expand Down
Binary file modified Stripe/Resources/Localizations/da.lproj/Localizable.strings
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/de.lproj/Localizable.strings
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/en.lproj/Localizable.strings
Binary file not shown.
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/es.lproj/Localizable.strings
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/fi.lproj/Localizable.strings
Binary file not shown.
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/fr.lproj/Localizable.strings
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/it.lproj/Localizable.strings
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/ja.lproj/Localizable.strings
Binary file not shown.
121 changes: 119 additions & 2 deletions Stripe/Resources/Localizations/nb.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
/* {card brand} ending in {last4} */
"%@ Ending In %@" = "%1$@ som slutter på %2$@";

/* Source type brand name */
"3D Secure" = "3D Secure";

/* part of {Account} ending in {last4} */
"Account" = "Konto";

/* Title for address entry section */
"ACCOUNT HOLDER ADDRESS" = "KONTOHOLDERS ADRESSE";

/* Caption for Name field on bank info form */
"Account Holder Name" = "Kortholders navn";

/* Title for Add a Card view */
"Add a Card" = "Legg til kort";

/* Title for SEPA Debit Account form */
"Add a Direct Debit Account" = "Legg til en direktedebiteringskonto";

/* Button to add a new credit card. */
"Add New Card…" = "Legg til nytt kort…";

/* Caption for Address field on address form */
"Address" = "Adresse";

/* Source type brand name */
"Alipay" = "Alipay";

/* Text for Apple Pay payment method */
"Apple Pay" = "Apple Pay";

/* Caption for Apartment/Address line 2 field on address form */
"Apt." = "Leil.";

/* Text for back button */
"Back" = "Tilbake";

/* Source type brand name */
"Bancontact" = "Bancontact";

/* Title for bank picker section */
"BANK" = "BANK";

/* Title for bank account information form */
"BANK ACCOUNT INFORMATION" = "Bankkontoinformasjon";

/* Title for billing address entry section */
"Billing Address" = "Fakturaadresse";

/* Title for billing address entry section */
"BILLING ADDRESS" = "FAKTURAADRESSE";

/* SEPA legal authorization text – must use official translations. */
"By providing your IBAN and confirming this payment, you are authorizing %@ and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited." = "Ved å oppgi IBAN og bekrefte denne betalingen, autoriserer du %@ og Stripe, betalingsleverandøren vår, til å sende instruksjoner til banken for å debitere kontoen din i henhold til disse instruksjonene. Du har krav på tilbakebetaling fra banken din i henhold til vilkårene i avtalen med banken din. Tilbakebetaling må påkreves innen 8 uker fra den dato da kontoen din ble belastet.";

/* Title for credit card number entry field */
"Card" = "Kort";

/* Title for card number entry field */
"CARD" = "KORT";

/* accessibility label for text field */
"card number" = "kortnummer";

Expand All @@ -31,42 +70,96 @@
/* Title for contact info form */
"Contact" = "Kontakt";

/* Title for contact info form */
"CONTACT" = "KONTAKT";

/* Text for continue button */
"Continue" = "Fortsett";

/* Caption for Country field on address form */
"Country" = "Land";

/* Title for country picker section */
"COUNTRY" = "LAND";

/* Caption for County field on address form (only countries that use county, like United Kingdom) */
"County" = "Fylke";

/* Label for entering CVC in text field */
"CVC" = "CVC";

/* Label for entering CVV in text field */
"CVV" = "CVV";

/* Title for delivery info form */
"Delivery" = "Leveranse";

/* Title for delivery address entry section */
"Delivery Address" = "Leveringsadresse";

/* Title for delivery address entry section */
"DELIVERY ADDRESS" = "LEVERINGSADRESSE";

/* Caption for Email field on address form */
"Email" = "E-post";

/* Source type brand name */
"EPS" = "EPS";

/* accessibility label for text field */
"expiration date" = "utløpsdato";

/* Label for free shipping method */
"Free" = "Gratis";

/* Source type brand name */
"Giropay" = "Giropay";

/* IBAN placeholder – don't translate */
"IBAN" = "IBAN";

/* Source type brand name */
"iDEAL" = "iDEAL";

/* Shipping form error message */
"Invalid Shipping Address" = "Ugyldig leveringsadresse";

/* Title for screen when data is still loading from the network. */
"Loading…" = "Laster…";
"Loading…" = "Laster ...";

/* label for text field to enter card expiry */
"MM/YY" = "MM/ÅÅ";

/* Title for payment options section */
"MORE OPTIONS" = "FLERE ALTERNATIVER";

/* Source type brand name */
"Multibanco" = "Multibanco";

/* Caption for Name field on address form */
"Name" = "Navn";

/* Label for button to add a new credit or debit card */
"New Card" = "Nytt kort";

/* Label for button to add a new SEPA Direct Debit account */
"New Direct Debit Account" = "Ny direktedebiteringskonto";

/* Accessibility label for button to add a new SEPA Direct Debit account */
"New SEPA Direct Debit Account" = "Ny SEPA-direktedebiteringskonto";

/* Button to move to the next text entry field */
"Next" = "Neste";

/* No comment provided by engineer. */
"OK" = "OK";

/* Source type brand name */
"P24" = "P24";

/* Pay with {payment method} */
"Pay with %@" = "Betal med %@";

/* Title for Payment Method screen */
"Payment Method" = "Betalingsmåte";

Expand All @@ -85,35 +178,59 @@
/* Text for button to scan a credit card */
"Scan Card" = "Skann kort";

/* part of {SEPA Account} ending in {last4} */
"SEPA Account" = "SEPA-konto";

/* Source type brand name */
"SEPA Direct Debit" = "SEPA-direktedebitering";

/* Title for shipping info form */
"Shipping" = "Frakt";

/* Title for shipping address entry section */
"Shipping Address" = "Sendingsadresse";

/* Title for shipping address entry section */
"SHIPPING ADDRESS" = "FORSENDELSESADRESSE";

/* Label for shipping method form */
"Shipping Method" = "Sendingsmetode";

/* Label for shipping method form */
"SHIPPING METHOD" = "FORSENDELSESMETODE";

/* Source type brand name */
"SOFORT" = "SOFORT";

/* Caption for State field on address form (only countries that use state , like United States) */
"State" = "Stat";

/* Caption for generalized state/province/region field on address form (not tied to a specific country's format) */
"State / Province / Region" = "Stat / Provins / Region";

/* Error when the seleted payment method is not available (eg attempted to use 3D Secure on a card that does not support it). */
"The selected payment method is not available." = "Den valgte betalingsmetoden er ikke tilgjengelig.";

/* Error when there is a problem processing the credit card */
"There was an error processing your card -- try again in a few seconds" = "Det oppstod en feil ved prosessering av kortet -- prøv igjen om et par sekunder";

/* Unexpected error, such as a 500 from Stripe or a JSON parse error */
"There was an unexpected error -- try again in a few seconds" = "En uventet feil har oppstått -- prøv igjen om et par sekunder";

/* Default missing source type label */
"Unknown" = "Ukjent";

/* Button to fill shipping address from billing address. */
"Use Billing" = "Bruk fakturaadresse";

/* Button to fill billing address from delivery address. */
"Use Delivery" = "Bruk leveringsadresse";

/* Button to fill billing address from shipping address. */
"Use Shipping" = "Bruk sendingsadresse";
"Use Shipping" = "Bruk forsendelse";

/* You'll be taken to {bank name} to finish your purchase. */
"You'll be taken to %@ to finish your purchase." = "Du tas med til %@ for å fullføre kjøpet ditt.";

/* Error when the card has already expired */
"Your card has expired" = "Kortet ditt har utløpt";
Expand Down
Binary file modified Stripe/Resources/Localizations/nl.lproj/Localizable.strings
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Stripe/Resources/Localizations/sv.lproj/Localizable.strings
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions ci_scripts/screenshot_localization_tester.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

for i in en,US zh-HANS,CN de,DE es,ES it,IT ja,JP nl,NL fr,FR fi,FI nb,NO da,DK pt-BR,BR pt-PT,PT sv,SE es-LA,AR fr-CA,CA nn,NO; do
#statements
IFS=",";
set -- $i;
xcodebuild clean test -workspace "${script_dir}/../Stripe.xcworkspace" -scheme "LocalizationTester" -configuration "Debug" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 6s,OS=11.4" -resultBundlePath "$HOME/Desktop/loc_qa/$1_$2" -testLanguage $1 -testRegion $2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably better to keep this inside the repository, instead of putting it on the desktop. Maybe in the build/ directory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

done