You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #822 [Translator] Type and documentation fixes (Kocal)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Translator] Type and documentation fixes
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Features and deprecations must be submitted against branch main.
-->
When working on the demo page, I've faced an issue about `Date` which was unuasable as translation parameter, but it should as we can use it to format date/datetime.
The documentation rendering was a bit broken too, I'm not familiar with RST, but it should be fixed.
Also, when running `yarn install`, the `yarn.lock` change, so I commited it aswell.
Commits
-------
8f472d5 [Translator] Type and documentation fixes
Copy file name to clipboardExpand all lines: src/Translator/doc/index.rst
+6-5
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,17 @@ Configuring the default locale
61
61
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62
62
63
63
By default, the default locale is ``en`` (English) that you can configure through many ways (in order of priority):
64
-
1. With ``setLocale('your-locale')`` from ``@symfony/ux-translator`` package
65
-
2. Or with ``<html data-symfony-ux-translator-locale="your-locale">`` attribute
66
-
3. Or with ``<html lang="your-locale">`` attribute
64
+
65
+
#. With ``setLocale('your-locale')`` from ``@symfony/ux-translator`` package
66
+
#. Or with ``<html data-symfony-ux-translator-locale="your-locale">`` attribute
67
+
#. Or with ``<html lang="your-locale">`` attribute
67
68
68
69
Importing and using translations
69
70
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70
71
71
-
If you use the Symfony Flex recipe, you can import the ``trans()`` function and your translations in your assets from the file `assets/translator.js`.
72
+
If you use the Symfony Flex recipe, you can import the ``trans()`` function and your translations in your assets from the file ``assets/translator.js``.
72
73
73
-
Translations are available as named exports, by using the translation's id transformed in uppercase snake-case (e.g.: `my.translation` becomes `MY_TRANSLATION`),
74
+
Translations are available as named exports, by using the translation's id transformed in uppercase snake-case (e.g.: ``my.translation`` becomes ``MY_TRANSLATION``),
0 commit comments