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
Placeholders wrapped between '' should be treated as literal string, so User: '{user}' should be always translated to User: '{user}'. Currently it works correctly if PHP translator is used, but JS translator ignores quoting and replaces placeholders in every case, and produces User: 'rob006'. As a result translators needs to quote differently depending on context - we need User: '{user}' for JS and User: ''{user}'' for PHP. There is no convenient way to know where specific string is used, so this is super inconvenient for languages that use single quote by default. Currently there is ~40 such translations on Weblate: https://weblate.rob006.net/search/flarum/?offset=1&q=target%3Ar%22%27%5C%7B%22&sort_by=context&checksum= and it is hard to say which translations are correct and which should be fixed by replacing ' with ''.
Steps to Reproduce
Create User: ''{user}'' translation.
Expected Behavior
Results for $translator->trans('my-key', ['user' => 'rob006']) and app.translator.trans('my-key', { user: 'rob006' }) should be the same: User: 'rob006'.
Screenshots
No response
Environment
Flarum version: 1.6.2
PHP version: 7.4.33
Output of php flarum info
No response
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
Placeholders wrapped between
''
should be treated as literal string, soUser: '{user}'
should be always translated toUser: '{user}'
. Currently it works correctly if PHP translator is used, but JS translator ignores quoting and replaces placeholders in every case, and producesUser: 'rob006'
. As a result translators needs to quote differently depending on context - we needUser: '{user}'
for JS andUser: ''{user}''
for PHP. There is no convenient way to know where specific string is used, so this is super inconvenient for languages that use single quote by default. Currently there is ~40 such translations on Weblate: https://weblate.rob006.net/search/flarum/?offset=1&q=target%3Ar%22%27%5C%7B%22&sort_by=context&checksum= and it is hard to say which translations are correct and which should be fixed by replacing'
with''
.Steps to Reproduce
User: ''{user}''
translation.Expected Behavior
Results for
$translator->trans('my-key', ['user' => 'rob006'])
andapp.translator.trans('my-key', { user: 'rob006' })
should be the same:User: 'rob006'
.Screenshots
No response
Environment
Output of
php flarum info
No response
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: