@@ -55,6 +55,16 @@ export class DropArea extends LitUploaderBlock {
5555 @state ( )
5656 private _dropTextKey = 'drop-files-here' ;
5757
58+ private _isMultiple = false ;
59+ private _updateDropText ( ) : void {
60+ const customText = this . text ;
61+ if ( typeof customText === 'string' && customText . length > 0 ) {
62+ this . _dropTextKey = this . l10n ( customText ) || customText ;
63+ return ;
64+ }
65+ this . _dropTextKey = this . _isMultiple ? this . l10n ( 'drop-files-here' ) : this . l10n ( 'drop-file-here' ) ;
66+ }
67+
5868 private _destroyDropzone : ( ( ) => void ) | null = null ;
5969 private _destroyContentWrapperDropzone : ( ( ) => void ) | null = null ;
6070 private _contentWrapperRef : Ref < HTMLDivElement > = createRef ( ) ;
@@ -141,22 +151,22 @@ export class DropArea extends LitUploaderBlock {
141151 } ) ;
142152
143153 this . subConfigValue ( 'multiple' , ( val ) => {
144- const customText = this . text ;
145- if ( typeof customText === 'string' && customText . length > 0 ) {
146- this . _dropTextKey = this . l10n ( customText ) || customText ;
147- return ;
148- }
149- this . _dropTextKey = val ? this . l10n ( 'drop-files-here' ) : this . l10n ( 'drop-file-here' ) ;
154+ this . _isMultiple = Boolean ( val ) ;
155+ this . _updateDropText ( ) ;
150156 } ) ;
151157 }
152158
153- protected override willUpdate ( changedProperties : PropertyValues < this> ) : void {
159+ protected override willUpdate ( changedProperties : PropertyValues < this & { localeId : string } > ) : void {
154160 super . willUpdate ( changedProperties ) ;
155161
156162 if ( changedProperties . has ( 'disabled' ) ) {
157163 this . _updateIsEnabled ( ) ;
158164 this . _updateVisibility ( ) ;
159165 }
166+
167+ if ( changedProperties . has ( 'text' ) || changedProperties . has ( 'localeId' ) ) {
168+ this . _updateDropText ( ) ;
169+ }
160170 }
161171
162172 protected override updated ( changedProperties : PropertyValues < this> ) : void {
0 commit comments