Skip to content

Commit 735e5a3

Browse files
committed
[Translator] Mark the component as experimental
1 parent 0b02cef commit 735e5a3

18 files changed

+43
-7
lines changed

src/Translator/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Symfony UX Translator
22

3+
**EXPERIMENTAL** This component is currently experimental and is
4+
likely to change, or even change drastically.
5+
36
Symfony UX Translator integrates [Symfony Translation](https://symfony.com/doc/current/translation.html) for JavaScript.
47

58
**This repository is a READ-ONLY sub-tree split**. See

src/Translator/assets/dist/translator_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function formatIntl(id, parameters = {}, locale) {
1616
}
1717

1818
function strtr(string, replacePairs) {
19-
const regex = Object.entries(replacePairs).map(([from, to]) => {
19+
const regex = Object.entries(replacePairs).map(([from]) => {
2020
return from.replace(/([-[\]{}()*+?.\\^$|#,])/g, '\\$1');
2121
});
2222
if (regex.length === 0) {

src/Translator/src/CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
/**
1919
* @author Hugo Alliaume <[email protected]>
20+
*
21+
* @experimental
2022
*/
2123
class TranslationsCacheWarmer implements CacheWarmerInterface
2224
{

src/Translator/src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* @author Hugo Alliaume <[email protected]>
10+
*
11+
* @experimental
1012
*/
1113
class Configuration implements ConfigurationInterface
1214
{

src/Translator/src/DependencyInjection/TranslatorExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* @author Hugo Alliaume <[email protected]>
2121
*
2222
* @internal
23+
*
24+
* @experimental
2325
*/
2426
class TranslatorExtension extends Extension
2527
{

src/Translator/src/Intl/ErrorKind.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Adapted from https://github.com/formatjs/formatjs/blob/590f1f81b26934c6dc7a55fff938df5436c6f158/packages/icu-messageformat-parser/error.ts#L9-L77.
7+
*
8+
* @experimental
79
*/
810
final class ErrorKind
911
{

src/Translator/src/Intl/IntlMessageParser.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* Adapted from https://github.com/formatjs/formatjs/blob/590f1f81b26934c6dc7a55fff938df5436c6f158/packages/icu-messageformat-parser/parser.ts.
9+
*
10+
* @experimental
911
*/
1012
class IntlMessageParser
1113
{
@@ -391,7 +393,7 @@ private function parseArgumentOptions(
391393
case 'time':
392394
// Parse this range:
393395
// {name, number, style}
394-
// ^-------^
396+
// ^-------^
395397
$this->bumpSpace();
396398
/** @var array{style: string, styleLocation: Location}|null */
397399
$styleAndLocation = null;
@@ -500,7 +502,7 @@ private function parseArgumentOptions(
500502
case 'select':
501503
// Parse this range:
502504
// {name, plural, options}
503-
// ^---------^
505+
// ^---------^
504506
$typeEndPosition = clone $this->position;
505507
$this->bumpSpace();
506508

@@ -514,12 +516,12 @@ private function parseArgumentOptions(
514516

515517
// Parse offset:
516518
// {name, plural, offset:1, options}
517-
// ^-----^
518-
//
519+
// ^-----^
520+
//
519521
// or the first option:
520-
//
522+
//
521523
// {name, plural, one {...} other {...}}
522-
// ^--^
524+
// ^--^
523525
$identifierAndLocation = $this->parseIdentifierIfPossible();
524526

525527
$pluralOffset = 0;

src/Translator/src/Intl/Location.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Adapted from https://github.com/formatjs/formatjs/blob/590f1f81b26934c6dc7a55fff938df5436c6f158/packages/icu-messageformat-parser/types.ts#L58-L61.
7+
*
8+
* @experimental
79
*/
810
final class Location
911
{

src/Translator/src/Intl/Position.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Adapted from https://github.com/formatjs/formatjs/blob/590f1f81b26934c6dc7a55fff938df5436c6f158/packages/icu-messageformat-parser/types.ts#L53-L57.
7+
*
8+
* @experimental
79
*/
810
final class Position
911
{

src/Translator/src/Intl/SkeletonType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Adapted from https://github.com/formatjs/formatjs/blob/590f1f81b26934c6dc7a55fff938df5436c6f158/packages/icu-messageformat-parser/types.ts#L48-L51.
7+
*
8+
* @experimental
79
*/
810
final class SkeletonType
911
{

0 commit comments

Comments
 (0)