You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-14Lines changed: 41 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -452,18 +452,31 @@ Custom properties are supported via the usage of CMIS secondary type properties.
452
452
> SDM supports secondary properties with data types `String`, `Boolean`, `Decimal`, `Integer` and `DateTime`.
453
453
454
454
## Support for Maximum allowed uploads
455
-
This plugin allows you to customize the maximum number of uploads a user can perform. Once a user exceeds the defined limit, any further upload attempts will trigger an error. The error message shown to the user is also fully customizable. The annotation `@SDM.Attachments` should be used for defining the maximum upload limit and the error message.
455
+
This plugin allows you to customize the maximum number of uploads a user can perform. Once a user exceeds the defined limit, any further upload attempts will trigger an error. The error message shown to the user is also fully customizable. The annotation `@SDM.Attachments` should be used for defining the maximum upload limit.
456
456
457
457
Refer the following example from a sample Bookshop app:
458
458
- maxCount: Specifies the maximum number of documents a user is allowed to upload.
459
-
- maxCountError: Defines the error message displayed when the upload limit (maxCount) is exceeded.
460
459
461
460
```cds
462
461
extend entity Books with {
463
-
attachments : Composition of many Attachments @SDM.Attachments:{maxCount: 4, maxCountError:'Only 4 attachments allowed.'};
462
+
attachments : Composition of many Attachments @SDM.Attachments:{maxCount: 4};
464
463
}
465
464
466
465
```
466
+
467
+
#### Customizing the Maximum Count Error Message
468
+
469
+
To customize the error message displayed when the upload limit is exceeded, add the following key to your `messages_[languagecode].properties` file under `srv/src/main/resources`:
470
+
471
+
```properties
472
+
SDM.maxCountErrorMessage = Maximum number of attachments reached
473
+
```
474
+
475
+
Example for German language in `messages_de.properties`:
476
+
```properties
477
+
SDM.maxCountErrorMessage = Maximale Anzahl von Anhängen erreicht
478
+
```
479
+
467
480
> **Note**
468
481
>
469
482
> Once the maxCount is configured, it is recommended not to alter it. If the maxCount is altered, the previously uploaded documents will still be visible.
- Repeat for other entities and elements if you have defined multiple `composition of many Attachments`.
863
876
864
877
## Support for Localization
865
-
If the UI fields have to be available in the local language of the leading application ensure to add the below fields in the i18n_[languagecode].properties file under app/_i18n folder.
866
-
Default language translations are present in i18n.properties files. If leading application does not provide any keys and values in their language properties files then default english language messages are shown to the user.
867
878
868
-
Example i18n_de.properties for german language.
869
-
```
879
+
This plugin supports internationalization (i18n) for both UI fields and error messages, allowing you to provide translations in the local language of your leading application.
880
+
881
+
### UI Fields Localization
882
+
883
+
To translate UI fields, add the following keys to your `i18n_[languagecode].properties` file located under `app/_i18n` folder.
884
+
885
+
Default language translations are present in `i18n.properties` files. If the leading application does not provide translations in their language-specific properties files, default English language messages are shown to the user.
886
+
887
+
Example `i18n_de.properties` for German language:
888
+
```properties
870
889
Attachment=Attachment
871
890
Attachments=Attachments
872
-
Note=Attachment Note
891
+
Note=Attachment Note
873
892
Filename=File Name
874
893
linkUrl=Link Url
875
894
type=Type
876
-
```
877
-
For the exception messages as well the translation can be done by adding the translation to messages_[languagecode].properties files present under srv/src/main/resources.
878
-
Default language translations are present in messages.properties. If leading application does not provide any keys and values in their language properties files then default english language messages are shown to the user.
895
+
```
896
+
897
+
### Error Messages Localization
879
898
880
-
Example for german language
899
+
The plugin provides error message keys in the `SDMErrorKeys`[class](https://github.com/cap-java/sdm/blob/develop/sdm/src/main/java/com/sap/cds/sdm/constants/SDMErrorKeys.java). You can override these messages by adding translations to `messages_[languagecode].properties` files in your leading application under `srv/src/main/resources`.
900
+
901
+
Default messages are present in `SDMErrorMessages`[class](https://github.com/cap-java/sdm/blob/develop/sdm/src/main/java/com/sap/cds/sdm/constants/SDMErrorMessages.java). If the leading application does not provide translations in their language-specific properties files, these default English language messages are shown to the user.
902
+
903
+
Example `messages_de.properties` for German language:
904
+
```properties
905
+
SDM.virusRepoErrorMoreThan400MB=Sie können keine Dateien hochladen, die größer als 400 MB sind
906
+
SDM.userNotAuthorisedError=Sie verfügen nicht über die erforderlichen Berechtigungen zum Hochladen von Anhängen
907
+
SDM.mimetypeInvalidError=Der Dateityp ist nicht zulässig
908
+
SDM.maxCountErrorMessage=Maximale Anzahl von Anhängen erreicht
881
909
```
882
-
SDM.Attachments.maxCountError = Maximum number of attachments reached in German......
883
-
```
910
+
884
911
## Known Restrictions
885
912
886
913
- UI5 Version 1.135.0: This version causes error in upload of attachments.
0 commit comments