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

Update string resources #6608

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Update string resources #6608

merged 3 commits into from
Apr 27, 2023

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Apr 26, 2023

Summary

This pull request makes sure that our string resources use a stripe_ prefix to avoid conflicts with strings of the host application.

We don’t regard the strings as part of the public API, so we’ll release this as a patch update.

As a follow-up, #6603 will actually enforce the Stripe/stripe_ prefix for our resources. Because that changes touches even more files, I’m going to do it separately.

Motivation

Resolves #6395

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

@tillh-stripe tillh-stripe marked this pull request as ready for review April 26, 2023 19:47
@tillh-stripe tillh-stripe requested review from a team as code owners April 26, 2023 19:47
@jaynewstrom-stripe
Copy link
Collaborator

This is awesome! Thanks for doing this!!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2023

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │            compressed            │          uncompressed           
          ├───────────┬───────────┬──────────┼──────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old      │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼──────────┼───────────┼──────────
      dex │   3.3 MiB │   3.3 MiB │    +58 B │  7.3 MiB │   7.3 MiB │    +20 B 
     arsc │   2.1 MiB │   2.1 MiB │ +1.8 KiB │  2.1 MiB │   2.1 MiB │ +1.8 KiB 
 manifest │   4.6 KiB │   4.6 KiB │      0 B │ 22.3 KiB │  22.3 KiB │      0 B 
      res │ 867.3 KiB │ 866.9 KiB │   -365 B │  1.3 MiB │   1.3 MiB │   -516 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │     6 MiB │      0 B 
    asset │     3 MiB │     3 MiB │      0 B │    3 MiB │     3 MiB │      0 B 
    other │ 199.6 KiB │ 199.5 KiB │    -84 B │  447 KiB │ 446.8 KiB │   -164 B 
──────────┼───────────┼───────────┼──────────┼──────────┼───────────┼──────────
    total │    12 MiB │    12 MiB │ +1.4 KiB │ 20.2 MiB │  20.2 MiB │ +1.1 KiB 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 35776 │ 35776 │ 0 (+4 -4) 
   types │ 11812 │ 11812 │ 0 (+0 -0) 
 classes │  9924 │  9924 │ 0 (+0 -0) 
 methods │ 52687 │ 52687 │ 0 (+0 -0) 
  fields │ 33486 │ 33486 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff           
─────────┼──────┼──────┼────────────────
 configs │  291 │  291 │  0             
 entries │ 6916 │ 6915 │ -1 (+191 -192)
APK
     compressed      │     uncompressed     │                        
──────────┬──────────┼───────────┬──────────┤                        
 size     │ diff     │ size      │ diff     │ path                   
──────────┼──────────┼───────────┼──────────┼────────────────────────
  2.1 MiB │ +1.8 KiB │   2.1 MiB │ +1.8 KiB │ ∆ resources.arsc       
          │   -349 B │           │   -516 B │ - res/3V.xml           
  3.3 MiB │    +58 B │   7.3 MiB │    +20 B │ ∆ classes.dex          
 62.6 KiB │    -51 B │ 140.9 KiB │    -82 B │ ∆ META-INF/CERT.SF     
 48.3 KiB │    -31 B │ 140.8 KiB │    -82 B │ ∆ META-INF/MANIFEST.MF 
  3.1 KiB │     -7 B │  21.1 KiB │      0 B │ ∆ res/dn.xml           
  3.2 KiB │     -6 B │  21.4 KiB │      0 B │ ∆ res/s0.xml           
    520 B │     -4 B │     956 B │      0 B │ ∆ res/8_.xml           
    750 B │     -4 B │   1.5 KiB │      0 B │ ∆ res/M6.xml           
    695 B │     -4 B │   2.7 KiB │      0 B │ ∆ res/R0.xml           
    993 B │     -3 B │   2.8 KiB │      0 B │ ∆ res/AE.xml           
  1,023 B │     -3 B │   2.5 KiB │      0 B │ ∆ res/WL.xml           
    802 B │     -3 B │   1.7 KiB │      0 B │ ∆ res/wf.xml           
    410 B │     +2 B │     592 B │      0 B │ ∆ res/0N.xml           
    614 B │     -2 B │   1.2 KiB │      0 B │ ∆ res/38.xml           
    381 B │     +2 B │     724 B │      0 B │ ∆ res/3n.xml           
    409 B │     +2 B │     592 B │      0 B │ ∆ res/5P.xml           
  1.2 KiB │     +2 B │   3.9 KiB │      0 B │ ∆ res/7k.xml           
    399 B │     +2 B │     612 B │      0 B │ ∆ res/CG.xml           
    876 B │     -2 B │   2.3 KiB │      0 B │ ∆ res/Fs.xml           
    901 B │     -2 B │     2 KiB │      0 B │ ∆ res/XS.xml           
    734 B │     -2 B │   1.4 KiB │      0 B │ ∆ res/_Y.xml           
    545 B │     +2 B │     952 B │      0 B │ ∆ res/a2.xml           
    752 B │     +2 B │   1.7 KiB │      0 B │ ∆ res/ew.xml           
    410 B │     +2 B │     592 B │      0 B │ ∆ res/iV.xml           
    620 B │     +2 B │   1.2 KiB │      0 B │ ∆ res/jH.xml           
  1.2 KiB │     -2 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA    
    684 B │     -1 B │   1.3 KiB │      0 B │ ∆ res/-G.xml           
    849 B │     +1 B │   1.8 KiB │      0 B │ ∆ res/0M.xml           
    429 B │     +1 B │     736 B │      0 B │ ∆ res/1J.xml           
    440 B │     -1 B │     744 B │      0 B │ ∆ res/4F.xml           
    440 B │     -1 B │     744 B │      0 B │ ∆ res/5J.xml           
    948 B │     -1 B │   2.5 KiB │      0 B │ ∆ res/5d.xml           
    649 B │     +1 B │   1.3 KiB │      0 B │ ∆ res/5d1.xml          
    536 B │     -1 B │   1.1 KiB │      0 B │ ∆ res/6J.xml           
    807 B │     -1 B │   1.8 KiB │      0 B │ ∆ res/75.xml           
    493 B │     +1 B │     836 B │      0 B │ ∆ res/7A.xml           
    353 B │     +1 B │     524 B │      0 B │ ∆ res/8E.xml           
    370 B │     +1 B │     472 B │      0 B │ ∆ res/A1.xml           
    639 B │     +1 B │   1.2 KiB │      0 B │ ∆ res/Am.xml           
    764 B │     +1 B │   1.4 KiB │      0 B │ ∆ res/BA.xml           
    355 B │     -1 B │     516 B │      0 B │ ∆ res/C-.xml           
    886 B │     -1 B │   2.4 KiB │      0 B │ ∆ res/C7.xml           
    708 B │     +1 B │   1.3 KiB │      0 B │ ∆ res/CF.xml           
    408 B │     +1 B │     592 B │      0 B │ ∆ res/DC.xml           
    619 B │     +1 B │   1.1 KiB │      0 B │ ∆ res/EF.xml           
    763 B │     +1 B │   1.6 KiB │      0 B │ ∆ res/I-.xml           
    444 B │     +1 B │     816 B │      0 B │ ∆ res/Jn.xml           
    601 B │     +1 B │   1.1 KiB │      0 B │ ∆ res/MP1.xml          
    783 B │     -1 B │   1.7 KiB │      0 B │ ∆ res/Os.xml           
    518 B │     +1 B │     988 B │      0 B │ ∆ res/SS.xml           
    524 B │     -1 B │     872 B │      0 B │ ∆ res/Ub.xml           
    534 B │     +1 B │     984 B │      0 B │ ∆ res/WT.xml           
    461 B │     -1 B │     728 B │      0 B │ ∆ res/ZI.xml           
    533 B │     -1 B │     984 B │      0 B │ ∆ res/aR.xml           
    383 B │     +1 B │     724 B │      0 B │ ∆ res/cR1.xml          
    502 B │     -1 B │     984 B │      0 B │ ∆ res/cS.xml           
    510 B │     +1 B │     880 B │      0 B │ ∆ res/d2.xml           
    826 B │     -1 B │   2.4 KiB │      0 B │ ∆ res/dI.xml           
    643 B │     -1 B │   1.3 KiB │      0 B │ ∆ res/fL.xml           
    829 B │     -1 B
...✂
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   35776 │ 35776 │ 0 (+4 -4) 
  + context.getString(R.string.stripe_price_free)
  + getString(R.string.strip…lid_shipping_information)
  + resources.getString(R.st….stripe_add_bank_account)
  + resources.getString(R.st…_address_country_invalid)
  
  - context.getString(R.string.price_free)
  - getString(R.string.invalid_shipping_information)
  - resources.getString(R.string.add_bank_account)
  - resources.getString(R.st….address_country_invalid)
ARSC
ENTRIES:

   old  │ new  │ diff           
  ──────┼──────┼────────────────
   6916 │ 6915 │ -1 (+191 -192) 
  + string/stripe_acc_label_card_number
  + string/stripe_acc_label_card_number_node
  + string/stripe_acc_label_cvc_node
  + string/stripe_acc_label_expiry_date
  + string/stripe_acc_label_expiry_date_node
  + string/stripe_acc_label_zip
  + string/stripe_acc_label_zip_short
  + string/stripe_add_bank_account
  + string/stripe_add_new_payment_method
  + string/stripe_add_payment_method
  + string/stripe_added
  + string/stripe_address_city_required
  + string/stripe_address_country_invalid
  + string/stripe_address_county_required
  + string/stripe_address_label_address
  + string/stripe_address_label_address_line1
  + string/stripe_address_label_address_line1_optional
  + string/stripe_address_label_address_line2
  + string/stripe_address_label_address_line2_optional
  + string/stripe_address_label_address_optional
  + string/stripe_address_label_ae_emirate
  + string/stripe_address_label_apt_optional
  + string/stripe_address_label_au_suburb_or_city
  + string/stripe_address_label_bb_jm_parish
  + string/stripe_address_label_cedex
  + string/stripe_address_label_city
  + string/stripe_address_label_city_optional
  + string/stripe_address_label_country
  + string/stripe_address_label_country_or_region
  + string/stripe_address_label_county
  + string/stripe_address_label_county_optional
  + string/stripe_address_label_department
  + string/stripe_address_label_district
  + string/stripe_address_label_full_name
  + string/stripe_address_label_hk_area
  + string/stripe_address_label_ie_eircode
  + string/stripe_address_label_ie_townland
  + string/stripe_address_label_in_pin
  + string/stripe_address_label_island
  + string/stripe_address_label_jp_prefecture
  + string/stripe_address_label_kr_do_si
  + string/stripe_address_label_name
  + string/stripe_address_label_neighborhood
  + string/stripe_address_label_oblast
  + string/stripe_address_label_phone_number
  + string/stripe_address_label_phone_number_optional
  + string/stripe_address_label_post_town
  + string/stripe_address_label_postal_code
  + string/stripe_address_label_postal_code_optional
  + string/stripe_address_label_postcode
  + string/stripe_address_label_postcode_optional
  + string/stripe_address_label_province
  + string/stripe_address_label_province_optional
  + string/stripe_address_label_region_generic
  + string/stripe_address_label_region_generic_optional
  + string/stripe_address_label_state
  + string/stripe_address_label_state_optional
  + string/stripe_address_label_suburb
  + string/stripe_address_label_village_township
  + string/stripe_address_label_zip_code
  + string/stripe_address_label_zip_code_optional
  + string/stripe_address_label_zip_postal_code
  + string/stripe_address_label_zip_postal_code_optional
  + string/stripe_address_name_required
  + string/stripe_address_phone_number_required
  + string/stripe_address_postal_code_invalid
  + string/stripe_address_postcode_invalid
  + string/stripe_address_province_required
  + string/stripe_address_region_generic_required
  + string/stripe_address_required
  + string/stripe_address_search_content_description
  + string/stripe_address_state_required
  + string/stripe_address_zip_invalid
  + string/stripe_address_zip_postal_invalid
  + string/stripe_affirm_buy_now_pay_later
  + string/stripe_afterpay_clearpay_message
  + string/stripe_au_becs_account_name
  + string/stripe_au_becs_bsb_number
  + string/stripe_au_becs_mandate
  + string/stripe_back
  + string/stripe_bank_account_ending_in
  + string/stripe_becs_mandate_acceptance
  + string/stripe_becs_widget_account_number
  + string/stripe_becs_widget_account_number_incomplete
  + string/stripe_becs_widget_account_number_required
  + string/stripe_becs_widget_bsb
  + string/stripe_becs_widget_bsb_incomplete
  + string/stripe_becs_widget_bsb_invalid
  + string/stripe_becs_widget_email
  + string/stripe_becs_widget_email_invalid
  + string/stripe_becs_widget_email_required
  + string/stripe_becs_widget_name
  + string/stripe_becs_widget_name_required
  + string/stripe_billing_details
  + string/stripe_billing_same_as_shipping
  + string/stripe_blank_and_required
  + string/stripe_cancel
  + string/stripe_card_declined
  + string/stripe_card_ending_in
  + string/stripe_change
  + string/stripe_close
  + string/stripe_delete_payment_method
  + string/stripe_delete_payment_method_prompt_title
  + string/stripe_done
  + string/stri
...✂

@tillh-stripe tillh-stripe force-pushed the tillh/strings-with-prefix branch from 5a188d5 to 37c2e5b Compare April 26, 2023 19:56
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe left a comment

Choose a reason for hiding this comment

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

This is mostly a directional approval, as well as confirming nothing malicious is going on. Going through each line is a bit crazy.

@@ -283,7 +283,7 @@ internal fun UploadScreen(
}
LoadingButton(
modifier = Modifier.testTag(UPLOAD_SCREEN_CONTINUE_BUTTON_TAG),
text = stringResource(id = R.string.kontinue).uppercase(),
text = stringResource(id = R.string.stripe_kontinue).uppercase(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be able to spell this right now!

Copy link
Contributor

Choose a reason for hiding this comment

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

ah this is intentional as i was trying to avoid a keyword conflict

Copy link
Contributor

@jameswoo-stripe jameswoo-stripe left a comment

Choose a reason for hiding this comment

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

Lgtm! Browsed through the changes

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes!

(Sorry, I think this came from #6603 and I didn’t undo this change when branching off into this pull request.)

ccen-stripe
ccen-stripe previously approved these changes Apr 26, 2023
Copy link
Contributor

@ccen-stripe ccen-stripe left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@tillh-stripe tillh-stripe merged commit cb31871 into master Apr 27, 2023
@tillh-stripe tillh-stripe deleted the tillh/strings-with-prefix branch April 27, 2023 14:12
@tillh-stripe tillh-stripe mentioned this pull request Apr 27, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] String resources are not namespaced
4 participants