mirror of
https://github.com/symfony/ux-translator.git
synced 2026-03-24 00:12:19 +01:00
Drop Biome.js for oxfmt and oxlint
This commit is contained in:
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,5 +1,4 @@
|
||||
Please do not submit any Pull Requests here. They will be closed.
|
||||
---
|
||||
## Please do not submit any Pull Requests here. They will be closed.
|
||||
|
||||
Please submit your PR here instead:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
30
.github/workflows/close-pull-request.yml
vendored
30
.github/workflows/close-pull-request.yml
vendored
@@ -1,20 +1,20 @@
|
||||
name: Close Pull Request
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Thanks for your Pull Request! We love contributions.
|
||||
|
||||
However, you should instead open your PR on the main repository:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
This repository is what we call a "subtree split": a read-only subset of that main repository.
|
||||
We're looking forward to your PR there!
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Thanks for your Pull Request! We love contributions.
|
||||
|
||||
However, you should instead open your PR on the main repository:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
This repository is what we call a "subtree split": a read-only subset of that main repository.
|
||||
We're looking forward to your PR there!
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
branches: ["2.x"]
|
||||
maintained_branches: ["2.x"]
|
||||
doc_dir: "doc"
|
||||
branches: ['2.x']
|
||||
maintained_branches: ['2.x']
|
||||
doc_dir: 'doc'
|
||||
|
||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -2,7 +2,7 @@
|
||||
|
||||
## 2.32
|
||||
|
||||
- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants.
|
||||
- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants.
|
||||
|
||||
Translation keys are now simple strings instead of TypeScript constants.
|
||||
The main advantages are:
|
||||
@@ -13,6 +13,7 @@
|
||||
- And you can still get autocompletion and type-safety :rocket:
|
||||
|
||||
**Before:**
|
||||
|
||||
```typescript
|
||||
import { trans } from '@symfony/ux-translator';
|
||||
import { SYMFONY_GREAT } from '@app/translations';
|
||||
@@ -21,6 +22,7 @@
|
||||
```
|
||||
|
||||
**After:**
|
||||
|
||||
```typescript
|
||||
import { createTranslator } from '@symfony/ux-translator';
|
||||
import { messages } from '../var/translations/index.js';
|
||||
@@ -38,6 +40,7 @@
|
||||
for further reducing bundle size.
|
||||
|
||||
**For AssetMapper users:** You can remove the following entries from your `importmap.php`:
|
||||
|
||||
```php
|
||||
'@app/translations' => [
|
||||
'path' => './var/translations/index.js',
|
||||
@@ -49,56 +52,57 @@
|
||||
|
||||
**Note:** This is a breaking change, but the UX Translator component is still experimental.
|
||||
|
||||
- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters, instead of constructor arguments or method calls:
|
||||
- Removed `$dumpDir` and `$dumpTypeScript` constructor arguments
|
||||
- Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods
|
||||
- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters,
|
||||
instead of constructor arguments or method calls:
|
||||
- Removed `$dumpDir` and `$dumpTypeScript` constructor arguments
|
||||
- Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods
|
||||
|
||||
**Note:** This is a breaking change, but the UX Translator component is still experimental.
|
||||
|
||||
- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping,
|
||||
default to `true`. Generating TypeScript types is useful when developing,
|
||||
but not in production when using the AssetMapper (which does not use these types).
|
||||
- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping,
|
||||
default to `true`. Generating TypeScript types is useful when developing,
|
||||
but not in production when using the AssetMapper (which does not use these types).
|
||||
|
||||
- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`)
|
||||
- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`)
|
||||
|
||||
## 2.30
|
||||
|
||||
- Ensure compatibility with PHP 8.5
|
||||
- Ensure compatibility with PHP 8.5
|
||||
|
||||
## 2.29.0
|
||||
|
||||
- Add Symfony 8 support
|
||||
- Add Symfony 8 support
|
||||
|
||||
## 2.22.0
|
||||
|
||||
- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes.
|
||||
- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes.
|
||||
|
||||
## 2.20.0
|
||||
|
||||
- Add `throwWhenNotFound` function to configure the behavior when a translation is not found.
|
||||
- Add `throwWhenNotFound` function to configure the behavior when a translation is not found.
|
||||
|
||||
## 2.19.0
|
||||
|
||||
- Add configuration to filter dumped translations by domain.
|
||||
- Add configuration to filter dumped translations by domain.
|
||||
|
||||
## 2.16.0
|
||||
|
||||
- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see
|
||||
a faster implementation of ICU messages parsing. #1443
|
||||
- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see
|
||||
a faster implementation of ICU messages parsing. #1443
|
||||
|
||||
## 2.13.2
|
||||
|
||||
- Revert "Change JavaScript package to `type: module`"
|
||||
- Revert "Change JavaScript package to `type: module`"
|
||||
|
||||
## 2.13.0
|
||||
|
||||
- Add Symfony 7 support.
|
||||
- Change JavaScript package to `type: module`
|
||||
- Add Symfony 7 support.
|
||||
- Change JavaScript package to `type: module`
|
||||
|
||||
## 2.9.0
|
||||
|
||||
- Add support for symfony/asset-mapper
|
||||
- Add support for symfony/asset-mapper
|
||||
|
||||
## 2.8.0
|
||||
|
||||
- Component added
|
||||
- Component added
|
||||
|
||||
@@ -10,7 +10,7 @@ https://github.com/symfony/ux to create issues or submit pull requests.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html)
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html)
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
|
||||
@@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-translator](https://packagist.org/packages/
|
||||
|
||||
This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.).
|
||||
|
||||
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
|
||||
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
|
||||
|
||||
If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) PHP package version:
|
||||
|
||||
```shell
|
||||
composer require symfony/ux-translator:2.23.0
|
||||
npm add @symfony/ux-translator@2.23.0
|
||||
@@ -18,7 +19,7 @@ npm add @symfony/ux-translator@2.23.0
|
||||
|
||||
## Resources
|
||||
|
||||
- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html)
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html)
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
|
||||
11
assets/dist/translator_controller.d.ts
vendored
11
assets/dist/translator_controller.d.ts
vendored
@@ -9,11 +9,12 @@ type ParametersType = Record<string, string | number | Date> | NoParametersType;
|
||||
type RemoveIntlIcuSuffix<T> = T extends `${infer U}+intl-icu` ? U : T;
|
||||
type DomainsOf<M> = M extends Message<infer Translations, LocaleType> ? keyof Translations : never;
|
||||
type LocaleOf<M> = M extends Message<TranslationsType, infer Locale> ? Locale : never;
|
||||
type ParametersOf<M, D extends DomainType> = M extends Message<infer Translations, LocaleType>
|
||||
? Translations[D] extends { parameters: infer Parameters }
|
||||
? Parameters
|
||||
: never
|
||||
: never;
|
||||
type ParametersOf<M, D extends DomainType> =
|
||||
M extends Message<infer Translations, LocaleType>
|
||||
? Translations[D] extends { parameters: infer Parameters }
|
||||
? Parameters
|
||||
: never
|
||||
: never;
|
||||
|
||||
interface Message<Translations extends TranslationsType, Locale extends LocaleType> {
|
||||
translations: {
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
"test": "pnpm run test:unit && pnpm run test:browser",
|
||||
"test:unit": "../../../bin/unit_test_package.sh .",
|
||||
"test:browser": "playwright test",
|
||||
"test:browser:ui": "playwright test --ui",
|
||||
"check": "biome check",
|
||||
"ci": "biome ci"
|
||||
"test:browser:ui": "playwright test --ui"
|
||||
},
|
||||
"symfony": {
|
||||
"importmap": {
|
||||
|
||||
11
assets/src/types.d.ts
vendored
11
assets/src/types.d.ts
vendored
@@ -9,11 +9,12 @@ export type ParametersType = Record<string, string | number | Date> | NoParamete
|
||||
export type RemoveIntlIcuSuffix<T> = T extends `${infer U}+intl-icu` ? U : T;
|
||||
export type DomainsOf<M> = M extends Message<infer Translations, LocaleType> ? keyof Translations : never;
|
||||
export type LocaleOf<M> = M extends Message<TranslationsType, infer Locale> ? Locale : never;
|
||||
export type ParametersOf<M, D extends DomainType> = M extends Message<infer Translations, LocaleType>
|
||||
? Translations[D] extends { parameters: infer Parameters }
|
||||
? Parameters
|
||||
: never
|
||||
: never;
|
||||
export type ParametersOf<M, D extends DomainType> =
|
||||
M extends Message<infer Translations, LocaleType>
|
||||
? Translations[D] extends { parameters: infer Parameters }
|
||||
? Parameters
|
||||
: never
|
||||
: never;
|
||||
|
||||
export interface Message<Translations extends TranslationsType, Locale extends LocaleType> {
|
||||
translations: {
|
||||
|
||||
Reference in New Issue
Block a user