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

Only use fallback error messages for non-Spain Spanish #7147

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Aug 14, 2023

Summary

This pull request restricts our error message fallback logic to Spanish locales that aren’t Spain itself.

Our backend is unable to provide translated error messages for some language tags. As a solution, we started using client error messages a while ago. However, these error messages aren’t in line with the Web and iOS messages and lack some detail.

Therefore, we now only use the client error messages for the “problematic” languages. As of right now, the only languages for which we are aware of this issue are Spanish languages outside of Spain, such as in Argentina or Chile.

Motivation

Resolves #7043

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

[FIXED] Fixed an issue where we displayed incorrect error messages for some languages.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 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.5 MiB │   3.5 MiB │ +207 B │   7.7 MiB │   7.7 MiB │ +164 B 
     arsc │   2.1 MiB │   2.1 MiB │    0 B │   2.1 MiB │   2.1 MiB │    0 B 
 manifest │   4.9 KiB │   4.9 KiB │    0 B │  24.1 KiB │  24.1 KiB │    0 B 
      res │ 867.8 KiB │ 867.8 KiB │    0 B │   1.3 MiB │   1.3 MiB │    0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │     6 MiB │     6 MiB │    0 B 
    asset │     3 MiB │     3 MiB │   -1 B │     3 MiB │     3 MiB │   -1 B 
    other │ 199.6 KiB │ 199.6 KiB │   +2 B │ 446.7 KiB │ 446.7 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  12.2 MiB │  12.2 MiB │ +208 B │  20.6 MiB │  20.6 MiB │ +163 B 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 38118 │ 38121 │ +3 (+4 -1) 
   types │ 12602 │ 12602 │  0 (+0 -0) 
 classes │ 10632 │ 10632 │  0 (+0 -0) 
 methods │ 55896 │ 55896 │  0 (+0 -0) 
  fields │ 35074 │ 35074 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  291 │  291 │  0   
 entries │ 6921 │ 6921 │  0
APK
    compressed     │    uncompressed    │                               
──────────┬────────┼───────────┬────────┤                               
 size     │ diff   │ size      │ diff   │ path                          
──────────┼────────┼───────────┼────────┼───────────────────────────────
  3.5 MiB │ +207 B │   7.7 MiB │ +164 B │ ∆ classes.dex                 
  5.1 KiB │   -1 B │     5 KiB │   -1 B │ ∆ assets/dexopt/baseline.prof 
 62.7 KiB │   +1 B │ 140.8 KiB │    0 B │ ∆ META-INF/CERT.SF            
  1.2 KiB │   +1 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA           
──────────┼────────┼───────────┼────────┼───────────────────────────────
  3.6 MiB │ +208 B │   7.9 MiB │ +163 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   38118 │ 38121 │ +3 (+4 -1) 
  + es
  + locale.country
  + locale.language
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:62aa106,r8-mode:full,version:8.0.46}
  
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:cdbec4e,r8-mode:full,version:8.0.46}

@tillh-stripe tillh-stripe force-pushed the tillh/error-message-fallback-tweaks branch from ac85312 to d5f671a Compare August 14, 2023 17:45
@tillh-stripe tillh-stripe marked this pull request as ready for review August 14, 2023 17:48
@tillh-stripe tillh-stripe requested review from a team as code owners August 14, 2023 17:48
@tillh-stripe tillh-stripe requested review from ccen-stripe, jameswoo-stripe and samer-stripe and removed request for ccen-stripe August 14, 2023 17:48
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.

Can we add a test for StripeErrorMapping with different locales?

@tillh-stripe tillh-stripe merged commit abb094a into master Aug 14, 2023
9 checks passed
@tillh-stripe tillh-stripe deleted the tillh/error-message-fallback-tweaks branch August 14, 2023 18:20
fionnbarrett-stripe pushed a commit that referenced this pull request Aug 17, 2023
* Only use fallback error messages for non-Spain Spanish

* Add tests

* Update changelog
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]
3 participants