Skip to content

Commit 17eeebc

Browse files
authored
feat(intl): add localization support (#1294)
1 parent b8b64d0 commit 17eeebc

File tree

114 files changed

+8882
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+8882
-313
lines changed

bin/release

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use Composer\Semver\VersionParser;
1818
use Tempest\Console\Console;
1919
use Tempest\Console\ConsoleApplication;
2020
use Tempest\Console\Exceptions\InterruptException;
21+
2122
use function Tempest\get;
2223
use function Tempest\Support\arr;
2324
use function Tempest\Support\str;
@@ -282,10 +283,10 @@ function ensureTagDoesNotExist(string $version): void
282283
}
283284

284285
/*
285-
|--------------------------------------------------------------------------
286-
| Script starts here.
287-
|--------------------------------------------------------------------------
288-
*/
286+
* |--------------------------------------------------------------------------
287+
* | Script starts here.
288+
* |--------------------------------------------------------------------------
289+
*/
289290

290291
try {
291292
ConsoleApplication::boot();
@@ -313,7 +314,7 @@ try {
313314

314315
if (! $console->confirm("The next tag will be <em>{$tag}</em>. Release?")) {
315316
$console->error('Cancelled.');
316-
exit;
317+
exit();
317318
}
318319

319320
// Bump PHP packages
@@ -364,6 +365,6 @@ try {
364365
$tag,
365366
));
366367

367-
exit;
368+
exit();
368369
} catch (InterruptException) {
369370
}

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"symfony/uid": "^7.1",
3636
"symfony/var-dumper": "^7.1",
3737
"symfony/var-exporter": "^7.1",
38+
"symfony/yaml": "^7.3",
3839
"tempest/highlight": "^2.11.4",
3940
"vlucas/phpdotenv": "^5.6",
4041
"voku/portable-ascii": "^2.0.3"
@@ -82,6 +83,7 @@
8283
"tempest/generation": "self.version",
8384
"tempest/http": "self.version",
8485
"tempest/http-client": "self.version",
86+
"tempest/intl": "self.version",
8587
"tempest/log": "self.version",
8688
"tempest/mapper": "self.version",
8789
"tempest/reflection": "self.version",
@@ -116,6 +118,7 @@
116118
"Tempest\\Generation\\": "packages/generation/src",
117119
"Tempest\\HttpClient\\": "packages/http-client/src",
118120
"Tempest\\Http\\": "packages/http/src",
121+
"Tempest\\Intl\\": "packages/intl/src",
119122
"Tempest\\Log\\": "packages/log/src",
120123
"Tempest\\Mapper\\": "packages/mapper/src",
121124
"Tempest\\Reflection\\": "packages/reflection/src",
@@ -136,6 +139,8 @@
136139
"packages/datetime/src/functions.php",
137140
"packages/debug/src/functions.php",
138141
"packages/event-bus/src/functions.php",
142+
"packages/intl/src/Number/functions.php",
143+
"packages/intl/src/functions.php",
139144
"packages/mapper/src/functions.php",
140145
"packages/reflection/src/functions.php",
141146
"packages/router/src/functions.php",
@@ -144,11 +149,9 @@
144149
"packages/support/src/Filesystem/functions.php",
145150
"packages/support/src/Html/functions.php",
146151
"packages/support/src/Json/functions.php",
147-
"packages/support/src/Language/functions.php",
148152
"packages/support/src/Math/constants.php",
149153
"packages/support/src/Math/functions.php",
150154
"packages/support/src/Namespace/functions.php",
151-
"packages/support/src/Number/functions.php",
152155
"packages/support/src/Path/functions.php",
153156
"packages/support/src/Random/functions.php",
154157
"packages/support/src/Regex/functions.php",
@@ -173,6 +176,7 @@
173176
"Tempest\\Generation\\Tests\\": "packages/generation/tests",
174177
"Tempest\\HttpClient\\Tests\\": "packages/http-client/tests",
175178
"Tempest\\Http\\Tests\\": "packages/http/tests",
179+
"Tempest\\Intl\\Tests\\": "packages/intl/tests",
176180
"Tempest\\Log\\Tests\\": "packages/log/tests",
177181
"Tempest\\Mapper\\Tests\\": "packages/mapper/tests",
178182
"Tempest\\Reflection\\Tests\\": "packages/reflection/tests",
@@ -201,6 +205,7 @@
201205
"phpstan": "vendor/bin/phpstan analyse src tests --memory-limit=1G",
202206
"rector": "vendor/bin/rector process --no-ansi",
203207
"merge": "php -d\"error_reporting = E_ALL & ~E_DEPRECATED\" vendor/bin/monorepo-builder merge",
208+
"intl:plural": "./packages/intl/bin/plural-rules.php",
204209
"release": [
205210
"composer qa",
206211
"./bin/release"

packages/database/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"tempest/container": "dev-main",
1010
"tempest/event-bus": "dev-main",
1111
"tempest/mapper": "dev-main",
12+
"tempest/intl": "dev-main",
1213
"tempest/support": "dev-main"
1314
},
1415
"autoload": {

packages/database/tests/Tables/PluralizedSnakeCaseStrategyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Tempest\Container\GenericContainer;
1010
use Tempest\Database\Migrations\Migration;
1111
use Tempest\Database\Tables\PluralizedSnakeCaseStrategy;
12-
use Tempest\Support\Pluralizer\PluralizerInitializer;
12+
use Tempest\Intl\Pluralizer\PluralizerInitializer;
1313

1414
/**
1515
* @internal

packages/datetime/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"minimum-stability": "dev",
66
"require": {
77
"php": "^8.4",
8+
"tempest/intl": "dev-main",
89
"tempest/support": "dev-main"
910
},
1011
"autoload": {

packages/datetime/src/DateTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use DateTimeInterface as NativeDateTimeInterface;
88
use IntlCalendar;
9-
use Tempest\Support\Language\Locale;
9+
use Tempest\Intl\Locale;
1010

1111
/**
1212
* Represents a date and time in a specific timezone.

packages/datetime/src/DateTimeConvenienceMethods.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Tempest\DateTime;
66

7-
use Tempest\Support\Language\Locale;
7+
use Tempest\Intl\Locale;
88
use Tempest\Support\Math;
99

1010
/**

packages/datetime/src/DateTimeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Tempest\DateTime;
66

7-
use Tempest\Support\Language\Locale;
7+
use Tempest\Intl\Locale;
88

99
interface DateTimeInterface extends TemporalInterface
1010
{

packages/datetime/src/TemporalConvenienceMethods.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
use DateTimeImmutable as NativeDateTimeImmutable;
88
use DateTimeInterface as NativeDateTimeInterface;
9+
use Tempest\Intl\Locale;
910
use Tempest\Support\Comparison;
1011
use Tempest\Support\Comparison\Order;
11-
use Tempest\Support\Language\Locale;
1212

1313
/**
1414
* @require-implements TemporalInterface

packages/datetime/src/TemporalInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
use DateTimeInterface as NativeDateTimeInterface;
88
use JsonSerializable;
99
use Stringable;
10+
use Tempest\Intl\Locale;
1011
use Tempest\Support\Comparison\Comparable;
1112
use Tempest\Support\Comparison\Equable;
1213
use Tempest\Support\Comparison\Order;
13-
use Tempest\Support\Language\Locale;
1414

1515
/**
1616
* Represents a temporal object that can be manipulated and compared.

0 commit comments

Comments
 (0)