Skip to content

Commit 8e17cd2

Browse files
committed
Simplify 'english default' docs
1 parent 53bb2b2 commit 8e17cd2

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

README.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ cronstrue.toString("@monthly");
9898

9999
For more usage examples, including a demonstration of how cRonstrue can handle some very complex cron expressions, you can [reference the unit tests](https://github.com/bradymholt/cRonstrue/blob/main/test/cronstrue.ts).
100100

101+
### i18n
102+
103+
By default, only the English translation (`en`) is included when you import and use cRonstrue. To use other languages, please see the [i18n section](#i18n) below.
104+
101105
### CLI Usage
102106

103107
```sh
@@ -124,7 +128,7 @@ An options object can be passed as the second parameter to `cronstrue.toString`.
124128
- **dayOfWeekStartIndexZero: boolean** - Whether to interpret cron expression DOW `1` as Sunday or Monday. (Default: true)
125129
- **monthStartIndexZero: boolean** - Whether to interpret January as `0` or `1`. (Default: false)
126130
- **use24HourTimeFormat: boolean** - If true, descriptions will use a [24-hour clock](https://en.wikipedia.org/wiki/24-hour_clock) (Default: false but some translations will default to true)
127-
- **locale: string** - The locale to use (Default: "en" - see [Default Locale](#default-locale-english))
131+
- **locale: string** - The locale to use (Default: "en")
128132
- **logicalAndDayFields: boolean** - If true, descriptions for cron expressions with both day of month and day of week specified will follow a logical-AND wording rather than logical-OR wording; e.g. "...between day 11 and 17 of the month, only on Friday" rather than "...between day 11 and 17 of the month, and on Friday" (Default: false)
129133

130134
## i18n
@@ -173,25 +177,6 @@ cronstrue.toString("*/5 * * * *", { locale: "fr" }); // => Toutes les 5 minutes
173177
cronstrue.toString("*/5 * * * *", { locale: "es" }); // => Cada 5 minutos
174178
```
175179

176-
### Default Locale (English)
177-
178-
The English locale (`en`) is the default locale included with the main cronstrue module (no need to explicitly import). In addition, `en` is set as the default locale option, so you do not need to include it in the `.toString()` options (see [Options](#options)).
179-
180-
```js
181-
// Node / CommonJS
182-
// English (`en`) is included with main cronstrue module
183-
const cronstrue = require('cronstrue');
184-
185-
// ESM / webpack / TypeScript
186-
import cronstrue from 'cronstrue';
187-
188-
// Browser
189-
<script src="https://unpkg.com/cronstrue@latest/dist/cronstrue.min.js" async></script>
190-
191-
// English (`en`) is the default locale option
192-
cronstrue.toString("*/5 * * * *"); // => Every 5 minutes
193-
```
194-
195180
### Supported Locales
196181

197182
The following locales can be passed in for the `locale` option. Thank you to the author (shown below) of each translation!

0 commit comments

Comments
 (0)