@@ -158,7 +158,10 @@ export class SignUp extends BaseResource implements SignUpResource {
158158
159159 // Inject browser locale if not already provided
160160 if ( ! finalParams . locale ) {
161- finalParams . locale = getBrowserLocale ( ) ;
161+ const browserLocale = getBrowserLocale ( ) ;
162+ if ( browserLocale ) {
163+ finalParams . locale = browserLocale ;
164+ }
162165 }
163166
164167 if ( ! __BUILD_DISABLE_RHC__ && ! this . clientBypass ( ) && ! this . shouldBypassCaptchaForAttempt ( params ) ) {
@@ -484,6 +487,7 @@ export class SignUp extends BaseResource implements SignUpResource {
484487 this . abandonAt = data . abandon_at ;
485488 this . web3wallet = data . web3_wallet ;
486489 this . legalAcceptedAt = data . legal_accepted_at ;
490+ this . locale = data . locale ;
487491 }
488492
489493 eventBus . emit ( 'resource:update' , { resource : this } ) ;
@@ -512,6 +516,7 @@ export class SignUp extends BaseResource implements SignUpResource {
512516 abandon_at : this . abandonAt ,
513517 web3_wallet : this . web3wallet ,
514518 legal_accepted_at : this . legalAcceptedAt ,
519+ locale : this . locale ,
515520 external_account : this . externalAccount ,
516521 external_account_strategy : this . externalAccount ?. strategy ,
517522 } ;
@@ -627,6 +632,10 @@ class SignUpFuture implements SignUpFutureResource {
627632 return this . resource . legalAcceptedAt ;
628633 }
629634
635+ get locale ( ) {
636+ return this . resource . locale ;
637+ }
638+
630639 get unverifiedFields ( ) {
631640 return this . resource . unverifiedFields ;
632641 }
@@ -685,7 +694,7 @@ class SignUpFuture implements SignUpFutureResource {
685694 async create ( params : SignUpFutureCreateParams ) : Promise < { error : unknown } > {
686695 return runAsyncResourceTask ( this . resource , async ( ) => {
687696 // Inject browser locale if not already provided
688- const locale = params . locale || getBrowserLocale ( ) ;
697+ const locale = params . locale || getBrowserLocale ( ) || undefined ;
689698 await this . _create ( { ...params , locale } ) ;
690699 } ) ;
691700 }
0 commit comments