Open the resource parameters and enable the Show number of shares left checkbox.
For a resource of the Rental type, it will appear as follows:
For a resource of the Event type, it will look like this:
You can also customize the text for the number of remaining shares, for example: "31 rooms of 100".
To do this, set a template for the text displaying the remaining places. Go to the Localization panel in the widget settings.
Add a new translation with the key SHARES_PATTERN and a value, for example, {0} rooms of {1}. Here, {0} will be replaced with the number of remaining shares, and {1} will be replaced with the total number.
How do you handle plural forms?
You can specify different text for different numbers of shares. To do this, add the following translation keys:
- SHARES_PATTERN_ONE = {0} room. Used for the singular form (relevant for English and some European languages).
- SHARES_PATTERN_OTHER = {0} rooms. General plural form (used in English and most other languages such as Japanese, Chinese, Thai).
- SHARES_PATTERN_FEW = {0} rooms. Used for the "few" form (e.g., 3, 23, 104) (relevant only for Slavic languages).
- SHARES_PATTERN_MANY = {0} rooms. Used for the "many" form (e.g., 5, 11, 120, 107). (relevant only for Slavic languages).
See this example in action.