mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +08:00
DEV: Lint MessageFormat strings to prevent usage of "one {foo 1 bar}" (#11608)
Follow-up to 6b53f26f
This commit is contained in:
parent
ff54d3a024
commit
fc9155f3ee
|
@ -2306,14 +2306,14 @@ en:
|
||||||
UNREAD, plural,
|
UNREAD, plural,
|
||||||
=0 {}
|
=0 {}
|
||||||
one {
|
one {
|
||||||
is <a href='{basePath}/unread'>1 unread</a>
|
is <a href='{basePath}/unread'># unread</a>
|
||||||
} other {
|
} other {
|
||||||
are <a href='{basePath}/unread'># unread</a>
|
are <a href='{basePath}/unread'># unread</a>
|
||||||
}
|
}
|
||||||
} {
|
} {
|
||||||
NEW, plural,
|
NEW, plural,
|
||||||
=0 {}
|
=0 {}
|
||||||
one { {BOTH, select, true{and } false {is } other{}} <a href='{basePath}/new'>1 new</a> topic}
|
one { {BOTH, select, true{and } false {is } other{}} <a href='{basePath}/new'># new</a> topic}
|
||||||
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/new'># new</a> topics}
|
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/new'># new</a> topics}
|
||||||
} remaining, or {CATEGORY, select, true {browse other topics in {catLink}} false {{latestLink}} other {}}"
|
} remaining, or {CATEGORY, select, true {browse other topics in {catLink}} false {{latestLink}} other {}}"
|
||||||
|
|
||||||
|
@ -3101,7 +3101,7 @@ en:
|
||||||
delete_spammer: "Delete Spammer"
|
delete_spammer: "Delete Spammer"
|
||||||
|
|
||||||
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
|
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
|
||||||
delete_confirm_MF: "You are about to delete {POSTS, plural, one {<b>1</b> post} other {<b>#</b> posts}} and {TOPICS, plural, one {<b>1</b> topic} other {<b>#</b> topics}} from this user, remove their account, block signups from their IP address <b>{ip_address}</b>, and add their email address <b>{email}</b> to a permanent block list. Are you sure this user is really a spammer?"
|
delete_confirm_MF: "You are about to delete {POSTS, plural, one {<b>#</b> post} other {<b>#</b> posts}} and {TOPICS, plural, one {<b>#</b> topic} other {<b>#</b> topics}} from this user, remove their account, block signups from their IP address <b>{ip_address}</b>, and add their email address <b>{email}</b> to a permanent block list. Are you sure this user is really a spammer?"
|
||||||
yes_delete_spammer: "Yes, Delete Spammer"
|
yes_delete_spammer: "Yes, Delete Spammer"
|
||||||
ip_address_missing: "(N/A)"
|
ip_address_missing: "(N/A)"
|
||||||
hidden_email_address: "(hidden)"
|
hidden_email_address: "(hidden)"
|
||||||
|
|
|
@ -97,7 +97,7 @@ class LocaleFileValidator
|
||||||
@errors[:invalid_interpolation_key_format] << key
|
@errors[:invalid_interpolation_key_format] << key
|
||||||
end
|
end
|
||||||
|
|
||||||
if key.end_with?("_MF") && value.match?(/one {1.*?}/)
|
if key.end_with?("_MF") && value.match?(/one {.*?1.*?}/)
|
||||||
@errors[:invalid_message_format_one_key] << key
|
@errors[:invalid_message_format_one_key] << key
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user