Skip to content

Commit 759d784

Browse files
committed
bug #929 Fix dynamic translation with ICU (matthieumota)
This PR was merged into the master branch. Discussion ---------- Fix dynamic translation with ICU I've run a simple Symfony demo and if you try to edit a post with 5 tags, you get an error due to [MessageFormatter](http://php.net/manual/fr/class.messageformatter.php) from icu used in [IntlFormatter](https://github.com/symfony/translation/blob/master/Formatter/IntlFormatter.php). It's due to ```{{ limit }}``` in message. No documentation about that but we can see in a [test](https://github.com/symfony/translation/blob/master/Tests/Formatter/IntlFormatterTest.php#L88) that ```{ variable }``` can be processed. So we must use ```{ limit }``` and no ```{{ limit }}``` in message translate with icu. I think to submit a PR to translation component for we can use ```{{ limit }}``` or ```{ limit }``` syntax. Commits ------- c91a3fc Fix dynamic translation with ICU
2 parents 642a2a7 + c91a3fc commit 759d784

20 files changed

+71
-71
lines changed

translations/validators+intl-icu.bg.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Съдержанието на публикацията е прекалено малко ({{ limit }} минимум символа)</target>
15+
<target>Съдержанието на публикацията е прекалено малко ({ limit } минимум символа)</target>
1616
</trans-unit>
1717
<trans-unit id="post.too_many_tags">
1818
<source>post.too_many_tags</source>
19-
<target>Прекалено много тагове (добави {{ limit }} тага или по-малко)</target>
19+
<target>Прекалено много тагове (добави { limit } тага или по-малко)</target>
2020
</trans-unit>
2121
<trans-unit id="comment.blank">
2222
<source>comment.blank</source>
2323
<target>Моля не оставяйте коментара празен!</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_short">
2626
<source>comment.too_short</source>
27-
<target>Коментара е пркалено кратък ({{ limit }} симвала минимум)</target>
27+
<target>Коментара е пркалено кратък ({ limit } симвала минимум)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.too_long">
3030
<source>comment.too_long</source>
31-
<target>Коментара е прекалено дълъг ({{ limit }} симвала максимум)</target>
31+
<target>Коментара е прекалено дълъг ({ limit } симвала максимум)</target>
3232
</trans-unit>
3333
<trans-unit id="comment.is_spam">
3434
<source>comment.is_spam</source>

translations/validators+intl-icu.ca.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>El contingut de l'article és massa curt ({{ limit }} caràcters com a mínim)</target>
15+
<target>El contingut de l'article és massa curt ({ limit } caràcters com a mínim)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>No és possible deixar buit el contingut del comentari.</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>El comentari és massa curt ({{ limit }} caràcters com a mínim)</target>
23+
<target>El comentari és massa curt ({ limit } caràcters com a mínim)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>El comentari és massa llarg ({{ limit }} caràcters com a màxim)</target>
27+
<target>El comentari és massa llarg ({ limit } caràcters com a màxim)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

translations/validators+intl-icu.cs.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
</trans-unit>
99
<trans-unit id="post.too_short_content">
1010
<source>post.too_short_content</source>
11-
<target>Příspěvek je příliš krátký (musí mít minimálně {{ limit }} znak)|Příspěvek je příliš krátký (musí mít minimálně {{ limit }} znaky)|Příspěvek je příliš krátký (musí mít minimálně {{ limit }} znaků)</target>
11+
<target>Příspěvek je příliš krátký (musí mít minimálně { limit } znak)|Příspěvek je příliš krátký (musí mít minimálně { limit } znaky)|Příspěvek je příliš krátký (musí mít minimálně { limit } znaků)</target>
1212
</trans-unit>
1313
<trans-unit id="comment.blank">
1414
<source>comment.blank</source>
1515
<target>Prosím, napište text komentáře!</target>
1616
</trans-unit>
1717
<trans-unit id="comment.too_short">
1818
<source>comment.too_short</source>
19-
<target>Komentář je příliš krátký (musí mít minimálně {{ limit }} znak)|Komentář je příliš krátký (musí mít minimálně {{ limit }} znaky)|Komentář je příliš krátký (musí mít minimálně {{ limit }} znaků)</target>
19+
<target>Komentář je příliš krátký (musí mít minimálně { limit } znak)|Komentář je příliš krátký (musí mít minimálně { limit } znaky)|Komentář je příliš krátký (musí mít minimálně { limit } znaků)</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_long">
2222
<source>comment.too_long</source>
23-
<target>Komentář je příliš dlouhý (musí mít maximálně {{ limit }} znak)|Komentář je příliš dlouhý (musí mít maximálně {{ limit }} znaky)|Komentář je příliš dlouhý (musí mít maximálně {{ limit }} znaků)</target>
23+
<target>Komentář je příliš dlouhý (musí mít maximálně { limit } znak)|Komentář je příliš dlouhý (musí mít maximálně { limit } znaky)|Komentář je příliš dlouhý (musí mít maximálně { limit } znaků)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.is_spam">
2626
<source>comment.is_spam</source>

translations/validators+intl-icu.de.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Der Beitragsinhalt ist zu kurz (mindestens {{ limit }} Zeichen)</target>
15+
<target>Der Beitragsinhalt ist zu kurz (mindestens { limit } Zeichen)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>Bitte gib einen Kommentar ein!</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>Der Kommentar ist zu kurz (mindestens {{ limit }} Zeichen)</target>
23+
<target>Der Kommentar ist zu kurz (mindestens { limit } Zeichen)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>Der Kommentar ist zu lang (maximal {{ limit }} Zeichen)</target>
27+
<target>Der Kommentar ist zu lang (maximal { limit } Zeichen)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>
3131
<target>Der Inhalt des Kommentars wird als Spam eingestuft.</target>
3232
</trans-unit>
3333
<trans-unit id="post.too_many_tags">
3434
<source>post.too_many_tags</source>
35-
<target>Zu viele Tags (höchstens {{ limit }} Tags sind erlaubt)</target>
35+
<target>Zu viele Tags (höchstens { limit } Tags sind erlaubt)</target>
3636
</trans-unit>
3737
</body>
3838
</file>

translations/validators+intl-icu.en.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Post content is too short ({{ limit }} characters minimum)</target>
15+
<target>Post content is too short ({ limit } characters minimum)</target>
1616
</trans-unit>
1717
<trans-unit id="post.too_many_tags">
1818
<source>post.too_many_tags</source>
19-
<target>Too many tags (add {{ limit }} tags or less)</target>
19+
<target>Too many tags (add { limit } tags or less)</target>
2020
</trans-unit>
2121
<trans-unit id="comment.blank">
2222
<source>comment.blank</source>
2323
<target>Please don't leave your comment blank!</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_short">
2626
<source>comment.too_short</source>
27-
<target>Comment is too short ({{ limit }} characters minimum)</target>
27+
<target>Comment is too short ({ limit } characters minimum)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.too_long">
3030
<source>comment.too_long</source>
31-
<target>Comment is too long ({{ limit }} characters maximum)</target>
31+
<target>Comment is too long ({ limit } characters maximum)</target>
3232
</trans-unit>
3333
<trans-unit id="comment.is_spam">
3434
<source>comment.is_spam</source>

translations/validators+intl-icu.es.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>El contenido del artículo es demasiado corto ({{ limit }} caracteres como mínimo)</target>
15+
<target>El contenido del artículo es demasiado corto ({ limit } caracteres como mínimo)</target>
1616
</trans-unit>
1717
<trans-unit id="post.too_many_tags">
1818
<source>post.too_many_tags</source>
19-
<target>Demasiadas etiquetas (añade {{ limit }} como máximo)</target>
19+
<target>Demasiadas etiquetas (añade { limit } como máximo)</target>
2020
</trans-unit>
2121
<trans-unit id="comment.blank">
2222
<source>comment.blank</source>
2323
<target>No es posible dejar el contenido del comentario vacío.</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_short">
2626
<source>comment.too_short</source>
27-
<target>El comentario es demasiado corto ({{ limit }} caracteres como mínimo)</target>
27+
<target>El comentario es demasiado corto ({ limit } caracteres como mínimo)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.too_long">
3030
<source>comment.too_long</source>
31-
<target>El comentario es demasiado largo ({{ limit }} caracteres como máximo)</target>
31+
<target>El comentario es demasiado largo ({ limit } caracteres como máximo)</target>
3232
</trans-unit>
3333
<trans-unit id="comment.is_spam">
3434
<source>comment.is_spam</source>

translations/validators+intl-icu.fr.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Le contenu de votre post est trop court ({{ limit }} caractères minimum)</target>
15+
<target>Le contenu de votre post est trop court ({ limit } caractères minimum)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>Veuillez ne pas laisser votre commentaire vide.</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>Votre commentaire est trop court ({{ limit }} caractères minimum)</target>
23+
<target>Votre commentaire est trop court ({ limit } caractères minimum)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>Votre commentaire est trop long ({{ limit }} caractères maximum)</target>
27+
<target>Votre commentaire est trop long ({ limit } caractères maximum)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

translations/validators+intl-icu.hr.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Sadržaj članka je prekratak (koristiti minimalno {{ limit }} slova ili simbola)</target>
15+
<target>Sadržaj članka je prekratak (koristiti minimalno { limit } slova ili simbola)</target>
1616
</trans-unit>
1717
<trans-unit id="post.too_many_tags">
1818
<source>post.too_many_tags</source>
19-
<target>Previše oznaka (dodaj najviše {{ limit }} oznaka ili manje)</target>
19+
<target>Previše oznaka (dodaj najviše { limit } oznaka ili manje)</target>
2020
</trans-unit>
2121
<trans-unit id="comment.blank">
2222
<source>comment.blank</source>
2323
<target>Molim ne ostavljajte svoj komentar praznim!</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_short">
2626
<source>comment.too_short</source>
27-
<target>Komentar je prekratak (potrebno je minimalno {{ limit }} slova ili simbola)</target>
27+
<target>Komentar je prekratak (potrebno je minimalno { limit } slova ili simbola)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.too_long">
3030
<source>comment.too_long</source>
31-
<target>Komentar je predugačak (koristiti maksimalno {{ limit }} slova ili simbola)</target>
31+
<target>Komentar je predugačak (koristiti maksimalno { limit } slova ili simbola)</target>
3232
</trans-unit>
3333
<trans-unit id="comment.is_spam">
3434
<source>comment.is_spam</source>

translations/validators+intl-icu.id.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Konten terlalu singkat (Minimal {{ limit }} karakter)</target>
15+
<target>Konten terlalu singkat (Minimal { limit } karakter)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>Mohon jangan tinggalkan komentar kosong!</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>Komentar terlalu singkat (Minimal {{ limit }} karakter)</target>
23+
<target>Komentar terlalu singkat (Minimal { limit } karakter)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>Komentar terlalu panjang (Maksimal {{ limit }} karakter)</target>
27+
<target>Komentar terlalu panjang (Maksimal { limit } karakter)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

translations/validators+intl-icu.it.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Il contenuto del post è troppo breve (minimo {{ limit }} caratteri)</target>
15+
<target>Il contenuto del post è troppo breve (minimo { limit } caratteri)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>Per favore non lasciare in bianco il tuo commento!</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>Il commento è troppo breve (minimo {{ limit }} caratteri)</target>
23+
<target>Il commento è troppo breve (minimo { limit } caratteri)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>Il commento è troppo lungo (massimo {{ limit }} caratteri)</target>
27+
<target>Il commento è troppo lungo (massimo { limit } caratteri)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

translations/validators+intl-icu.ja.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>本文が短すぎます ({{ limit }} 文字以上必要です)</target>
15+
<target>本文が短すぎます ({ limit } 文字以上必要です)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>コメントを入力してください。</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>コメントが短すぎます ({{ limit }} 文字以上必要です)</target>
23+
<target>コメントが短すぎます ({ limit } 文字以上必要です)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>コメントが長すぎます ({{ limit }} 文字以下にしてください)</target>
27+
<target>コメントが長すぎます ({ limit } 文字以下にしてください)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

translations/validators+intl-icu.nl.xlf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</trans-unit>
1313
<trans-unit id="post.too_short_content">
1414
<source>post.too_short_content</source>
15-
<target>Bericht inhoud is te kort (minimaal {{ limit }} karakters)</target>
15+
<target>Bericht inhoud is te kort (minimaal { limit } karakters)</target>
1616
</trans-unit>
1717
<trans-unit id="comment.blank">
1818
<source>comment.blank</source>
1919
<target>Vul alstublieft een reactie in.</target>
2020
</trans-unit>
2121
<trans-unit id="comment.too_short">
2222
<source>comment.too_short</source>
23-
<target>Reactie is te kort (minimaal {{ limit }} karakters)</target>
23+
<target>Reactie is te kort (minimaal { limit } karakters)</target>
2424
</trans-unit>
2525
<trans-unit id="comment.too_long">
2626
<source>comment.too_long</source>
27-
<target>Reactie is te lang (maximaal {{ limit }} karakters)</target>
27+
<target>Reactie is te lang (maximaal { limit } karakters)</target>
2828
</trans-unit>
2929
<trans-unit id="comment.is_spam">
3030
<source>comment.is_spam</source>

0 commit comments

Comments
 (0)