Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into upgrade-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Nov 20, 2023
2 parents a58492e + 3f9c3bd commit edf4eb3
Show file tree
Hide file tree
Showing 11 changed files with 564 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,49 +52,65 @@ jobs:
rm -rf docs/statuses/http-statuses
rm -rf docs/statuses/lang
rm -rf docs/statuses/native-locale-names
rm -rf docs/statuses/native-country-names
rm -rf docs/statuses/native-currency-names
mkdir docs/statuses/attributes
mkdir docs/statuses/http-statuses
mkdir docs/statuses/lang
mkdir docs/statuses/native-locale-names
mkdir docs/statuses/native-country-names
mkdir docs/statuses/native-currency-names
- name: Download repositories
run: |
git clone --no-tags --single-branch https://github.com/Laravel-Lang/attributes.git tmp/attributes
git clone --no-tags --single-branch https://github.com/Laravel-Lang/http-statuses.git tmp/http-statuses
git clone --no-tags --single-branch https://github.com/Laravel-Lang/lang.git tmp/lang
git clone --no-tags --single-branch https://github.com/Laravel-Lang/native-locale-names.git tmp/native-locale-names
git clone --no-tags --single-branch https://github.com/Laravel-Lang/native-country-names.git tmp/native-country-names
git clone --no-tags --single-branch https://github.com/Laravel-Lang/native-currency-names.git tmp/native-currency-names
- name: Move translation statuses
run: |
mv -f tmp/attributes/docs/status.md docs/statuses/attributes/index.md
mv -f tmp/http-statuses/docs/status.md docs/statuses/http-statuses/index.md
mv -f tmp/lang/docs/status.md docs/statuses/lang/index.md
mv -f tmp/native-locale-names/docs/status.md docs/statuses/native-locale-names/index.md
mv -f tmp/native-country-names/docs/status.md docs/statuses/native-country-names/index.md
mv -f tmp/native-currency-names/docs/status.md docs/statuses/native-currency-names/index.md
mv -f tmp/attributes/docs/statuses docs/statuses/attributes/statuses
mv -f tmp/http-statuses/docs/statuses docs/statuses/http-statuses/statuses
mv -f tmp/lang/docs/statuses docs/statuses/lang/statuses
mv -f tmp/native-locale-names/docs/statuses docs/statuses/native-locale-names/statuses
mv -f tmp/native-country-names/docs/statuses docs/statuses/native-country-names/statuses
mv -f tmp/native-currency-names/docs/statuses docs/statuses/native-currency-names/statuses
- name: Resolve page names
run: |
sed -i 's/# Completion Status/# Completion Status: Attributes/g' docs/statuses/attributes/index.md
sed -i 's/# Completion Status/# Completion Status: HTTP Statuses/g' docs/statuses/http-statuses/index.md
sed -i 's/# Completion Status/# Completion Status: Lang/g' docs/statuses/lang/index.md
sed -i 's/# Completion Status/# Completion Status: Native Locale Names/g' docs/statuses/native-locale-names/index.md
sed -i 's/# Completion Status/# Completion Status: Native Country Names/g' docs/statuses/native-country-names/index.md
sed -i 's/# Completion Status/# Completion Status: Native Currency Names/g' docs/statuses/native-currency-names/index.md
- name: Resolve navigation links
run: |
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/attributes/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/http-statuses/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/lang/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/native-locale-names/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/native-country-names/index.md
sed -i 's/<\/table>/<\/table>\n\n[ [go back](..\/index.md) | [to top](\#) ]/g' docs/statuses/native-currency-names/index.md
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/attributes/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/http-statuses/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/lang/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/native-locale-names/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/native-country-names/statuses/*
sed -i 's/..\/status.md/..\/index.md/g' docs/statuses/native-currency-names/statuses/*
- name: Build VuePress site
run: npm run build
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@
"laravel-lang/attributes": "^2.5.0",
"laravel-lang/http-statuses": "^3.5.0",
"laravel-lang/lang": "^13.3.0",
"laravel-lang/locale-list": "^1.1",
"laravel-lang/locales": "^1.9",
"laravel-lang/native-country-names": "^1.0",
"laravel-lang/native-currency-names": "^1.1",
"laravel-lang/native-locale-names": "^1.4",
"laravel-lang/publisher": "^15.0"
},
"require-dev": {
Expand Down
5 changes: 5 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module.exports = {
{text: 'Attributes', link: '/statuses/attributes/index.md'},
{text: 'HTTP Statuses', link: '/statuses/http-statuses/index.md'},
{text: 'Native Locale Names', link: '/statuses/native-locale-names/index.md'},
{text: 'Native Country Names', link: '/statuses/native-country-names/index.md'},
{text: 'Native Currency Names', link: '/statuses/native-currency-names/index.md'},
]
},
],
Expand Down Expand Up @@ -124,7 +126,10 @@ module.exports = {
text: 'Features',
children: [
'/usage/features/facades.md',
'/usage/features/locale-list.md',
'/usage/features/native-locale-names.md',
'/usage/features/native-country-names.md',
'/usage/features/native-currency-names.md',
'/usage/features/alignment.md',
'/usage/features/smart-punctuation.md',
]
Expand Down
18 changes: 17 additions & 1 deletion docs/installation/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ This package solves this problem.

## `laravel-lang/native-locale-names`

This package contains a list of localized language names.
This package contains a list of localized locale names.

I think there is no need to explain why it can be useful 🙂

## `laravel-lang/native-country-names`

This package contains a list of localized country names.

I think there is no need to explain why it can be useful 🙂

## `laravel-lang/native-currency-names`

This package contains a list of localized currency names with their codes.

## `laravel-lang/locale-list`

This package contains a list of available locales that all Laravel Lang Team packages work with.

All it contains is a single enum class that you can also use for your own purposes.
14 changes: 12 additions & 2 deletions docs/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ php artisan lang:update

## Recommended

To get the latest version of `Laravel Lang: Common`, simply require the project using [Composer](https://getcomposer.org):
To get the latest version of `Laravel Lang: Common`, simply require the project
using [Composer](https://getcomposer.org):

```bash:no-line-numbers
composer require --dev laravel-lang/common
```

::: tip
If you are using the list of localizations from the `Laravel Lang: Publisher` package in production, then use this command instead: `composer require laravel-lang/common`.
If you need a list of locales in production, separately install the `laravel-lang/locales` dependency by calling the
console command:

```bash:no-line-numbers
composer require laravel-lang/locales
```

:::

Now you can manage localizations:
Expand All @@ -41,5 +48,8 @@ composer require --dev laravel-lang/attributes
composer require --dev laravel-lang/http-statuses
composer require laravel-lang/locales
composer require laravel-lang/locale-list
composer require laravel-lang/native-locale-names
composer require laravel-lang/native-country-names
composer require laravel-lang/native-currency-names
```
2 changes: 2 additions & 0 deletions docs/statuses/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
* [Attributes](attributes/index.md)
* [HTTP Statuses](http-statuses/index.md)
* [Native Locale Names](native-locale-names/index.md)
* [Native Country Names](native-country-names/index.md)
* [Native Currency Names](native-currency-names/index.md)
107 changes: 107 additions & 0 deletions docs/usage/features/locale-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Locale List

В случае необходимости подключения к проекту только списка доступных локалей, Вы можете воспользоваться
пакетом [`laravel-lang/locale-list`](../../installation/index.md#alternative).

## As enum

```php
use LaravelLang\LocaleList\Locale;

return Locale::Bengali;
```

Result:

```php
LaravelLang\LocaleList\Locale {#11
+name: "Bengali"
+value: "bn"
}
```

## List of codes

:::tip
This list is not sorted during output.
:::

```php
use LaravelLang\LocaleList\Locale;

return Locale::values();
```

Result:

```php
array:79 [
0 => "af"
1 => "sq"
2 => "ar"
3 => "hy"
4 => "az"
5 => "eu"
6 => "be"
7 => "bn"
8 => "bs"
9 => "bg"
...
]
```

## List of titles

:::tip
This list is sorted alphabetically because the names are used as the keys of the enum class.
:::

```php
use LaravelLang\LocaleList\Locale;

return Locale::names();
```

Result:

```php
array:79 [
0 => "Afrikaans"
1 => "Albanian"
2 => "Arabic"
3 => "Armenian"
4 => "Azerbaijani"
5 => "Basque"
6 => "Belarusian"
7 => "Bengali"
8 => "Bosnian"
9 => "Bulgarian"
...
]
```

## List of codes and names

```php
use LaravelLang\LocaleList\Locale;

return Locale::options();
```

Result:

```php
array:79 [
"Afrikaans" => "af"
"Albanian" => "sq"
"Arabic" => "ar"
"Armenian" => "hy"
"Azerbaijani" => "az"
"Basque" => "eu"
"Belarusian" => "be"
"Bengali" => "bn"
"Bosnian" => "bs"
"Bulgarian" => "bg"
...
]
```
Loading

0 comments on commit edf4eb3

Please sign in to comment.