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
I'm trying to use the Polyglot plural syntax but it doesn't seem to be working as expected... I have the following string in my bundle:
"NumberOfNetworksReporting": "%{count} network is reporting |||| %{count} networks are reporting"
If I provide an object with interpolation values, it ends up printing the whole string with both forms, including the pipe characters:
<p>{props.p.tu('NumberOfNetworksReporting', { count: 0 })}</p>
<p>{props.p.tu('NumberOfNetworksReporting', { count: 1 })}</p>
<p>{props.p.tu('NumberOfNetworksReporting', { count: 2 })}</p>
Result:
0 NETWORK IS REPORTING |||| 0 NETWORKS ARE REPORTING
1 NETWORK IS REPORTING |||| 1 NETWORKS ARE REPORTING
2 NETWORK IS REPORTING |||| 2 NETWORKS ARE REPORTING
If I use Polyglot's alternate syntax (pass a number as the second argument), it appears to be doing the proper plural phrase selection, but it doesn't substitute the actual value:
<p>{props.p.tu('NumberOfNetworksReporting', 0)}</p>
<p>{props.p.tu('NumberOfNetworksReporting', 1)}</p>
<p>{props.p.tu('NumberOfNetworksReporting', 2)}</p>
Result:
%{COUNT} NETWORKS ARE REPORTING
%{COUNT} NETWORK IS REPORTING
%{COUNT} NETWORKS ARE REPORTING
Any suggestions?
Rick
The text was updated successfully, but these errors were encountered:
I'm trying to use the Polyglot plural syntax but it doesn't seem to be working as expected... I have the following string in my bundle:
"NumberOfNetworksReporting": "%{count} network is reporting |||| %{count} networks are reporting"
If I provide an object with interpolation values, it ends up printing the whole string with both forms, including the pipe characters:
If I use Polyglot's alternate syntax (pass a number as the second argument), it appears to be doing the proper plural phrase selection, but it doesn't substitute the actual value:
Any suggestions?
Rick
The text was updated successfully, but these errors were encountered: