Re-key all |zero-pluralised translations for Localazy compatibility (#11417)
* Re-key all |zero-pluralised translations for Localazy compatibility * Add missing interpolation variable * i18n * Add test coverage * Improve coverage
This commit is contained in:
committed by
GitHub
parent
a5107518b5
commit
6b14ecfdf9
@@ -76,16 +76,26 @@ export default function RoomNotifications({ onBack }: IDevtoolsProps): JSX.Eleme
|
||||
<h2>{_t("Room status")}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
{_t(
|
||||
"Room unread status: <strong>%(status)s</strong>, count: <strong>%(count)s</strong>",
|
||||
{
|
||||
status: humanReadableNotificationColor(color),
|
||||
count,
|
||||
},
|
||||
{
|
||||
strong: (sub) => <strong>{sub}</strong>,
|
||||
},
|
||||
)}
|
||||
{count > 0
|
||||
? _t(
|
||||
"Room unread status: <strong>%(status)s</strong>, count: <strong>%(count)s</strong>",
|
||||
{
|
||||
status: humanReadableNotificationColor(color),
|
||||
count,
|
||||
},
|
||||
{
|
||||
strong: (sub) => <strong>{sub}</strong>,
|
||||
},
|
||||
)
|
||||
: _t(
|
||||
"Room unread status: <strong>%(status)s</strong>",
|
||||
{
|
||||
status: humanReadableNotificationColor(color),
|
||||
},
|
||||
{
|
||||
strong: (sub) => <strong>{sub}</strong>,
|
||||
},
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{_t(
|
||||
|
||||
@@ -95,6 +95,11 @@ const RoomStateHistory: React.FC<{
|
||||
const StateEventButton: React.FC<StateEventButtonProps> = ({ label, onClick }) => {
|
||||
const trimmed = label.trim();
|
||||
|
||||
let content = label;
|
||||
if (!trimmed) {
|
||||
content = label.length > 0 ? _t("<%(count)s spaces>", { count: label.length }) : _t("<empty string>");
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
className={classNames("mx_DevTools_button", {
|
||||
@@ -103,7 +108,7 @@ const StateEventButton: React.FC<StateEventButtonProps> = ({ label, onClick }) =
|
||||
})}
|
||||
onClick={onClick}
|
||||
>
|
||||
{trimmed ? label : _t("<%(count)s spaces>", { count: label.length })}
|
||||
{content}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user