Skip to content

Commit

Permalink
Merge pull request #122 from froschdesign/hotfix/docs/83
Browse files Browse the repository at this point in the history
Expand documentation in introduction and validators files
  • Loading branch information
froschdesign authored May 21, 2024
2 parents b3259ac + 2d2917c commit 56c4033
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
29 changes: 27 additions & 2 deletions docs/book/introduction.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
# Introduction

`Laminas\I18n` comes with a complete translation suite which supports all major
## Translation

`Laminas\I18n` comes with a [complete translation](translation.md) suite which supports all major
formats and includes popular features like plural translations and text domains.
The Translator component is mostly dependency free, except for the fallback to a
default locale, where it relies on the Intl PHP extension.
default locale, where it relies on the `intl` PHP extension.

The translator itself is initialized without any parameters, as any configuration
to it is optional. A translator without any translations will actually do nothing
but just return the given message IDs.

## Filters and Validators

The `Laminas\I18n` component also provides a [set of filters](filters/introduction.md) for normalizing and formatting.

The component also provides a [set of validators](validators/introduction.md) for validating localized data.

## View Helpers

The `Laminas\I18n` component provides also a [set of view helpers](view-helpers/introduction.md) for formatting dates, times, numbers, currencies, and translating messages.

## Based on PHP's `intl` extension

The [`intl` extension](https://www.php.net/manual/book.intl.php) is a wrapper for the ICU library, which provides a lot of
internationalization functions. The `intl` extension is a standard PHP extension, and is required for the `Laminas\I18n` component to work.

The `intl` functions are used for locale detection, filtering and validating localized data, formatting localized data and more.
These functions are used in:

- Translator
- Filters
- Validators
- View Helpers
2 changes: 1 addition & 1 deletion docs/book/validators/date-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`Laminas\I18n\Validator\DateTime` allows you to determine if a given value **is a
valid date, time or datetime**.
Internally, PHP's `IntlDateFormatter` tries to create a date time for the given
value.
value and locale.

## Basic Usage

Expand Down
2 changes: 2 additions & 0 deletions docs/book/validators/is-float.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ example, using English, you might write `1.5`, whereas in german you would write
`Laminas\I18n\Validator\IsFloat` is able to validate such notations. However, it
is limited to the locale you set.

Internally, PHP's `NumberFormatter` (`ext/intl`) tries to create a formatted number for the given value and locale.

## Basic Usage

```php
Expand Down
2 changes: 2 additions & 0 deletions docs/book/validators/is-int.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ validity of an integer value. In such cases, it doesn't simply strip the
separator, but instead validates that the correct separator as defined by used
locale.

Internally, PHP's `NumberFormatter` (`ext/intl`) tries to create a formatted number for the given value and locale.

## Basic Usage

```php
Expand Down

0 comments on commit 56c4033

Please sign in to comment.