Skip to content

Commit fccd6b7

Browse files
committed
Add documentation for new locale information methods
1 parent e8f0590 commit fccd6b7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

resources/views/docs/desktop/1/the-basics/application.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ To get the current app version, use the `version` method. The version is defined
7070
$version = App::version();
7171
```
7272

73+
### Locale information
74+
75+
The facade offers several methods for accessing some of the system's localisation information.
76+
This data can be helpful for localising your application, e.g. if you want to suggest the corresponding language to the user on first launch.
77+
78+
```php
79+
App::getLocale();
80+
App::getLocaleCountryCode();
81+
App::getSystemLocale();
82+
```
83+
84+
The `getLocale` method will return the full locale string used by the app. This includes both the language and the country or region.
85+
`getLocaleCountryCode` returns only the country code part of the locale.
86+
With `getSystemLocale` you can access the system-wide locale setting. This is the locale set at the operating system level, not necessarily what the app is using.
87+
88+
7389
### App Badge Count
7490
_Only available on macOS and Linux_
7591

0 commit comments

Comments
 (0)