Our translators noticed a problem with the “Copy Source” button in the editor. Clicking that button seems to modify ICU strings and makes them invalid.
Here’s an example: https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/718/en-de#101146
English source string:
{ groupCount, plural,
=1 {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {Mentioning @{group1} exceeds the notification limit of # user.}
other {Mentioning @{group1} exceeds the notification limit of # users.}
}
}
other {}
}
}
=2 {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {Mentioning @{group1} and @{group2} exceeds the notification limit of # user.}
other {Mentioning @{group1} and @{group2} exceeds the notification limit of # users.}
}
}
other {}
}
}
other {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {Mentioning these {groupCount} groups exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning these {groupCount} groups exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {Mentioning these {groupCount} groups exceeds the notification limit of # user.}
other {Mentioning these {groupCount} groups exceeds the notification limit of # users.}
}
}
other {}
}
}
}
Clicking “Copy Source” creates a modified version of that string:
{ groupCount, plural,
one {}=1 {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {}one {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {}one {Mentioning @{group1} exceeds the notification limit of # user.}
other {Mentioning @{group1} exceeds the notification limit of # users.}
}
}
other {}
}
}
=2 {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {}one {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {}one {Mentioning @{group1} and @{group2} exceeds the notification limit of # user.}
other {Mentioning @{group1} and @{group2} exceeds the notification limit of # users.}
}
}
other {}
}
}
other {
{ isAdmin, select,
true {
{ notificationLimit, plural,
one {Mentioning these {groupCount} groups exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning these {groupCount} groups exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
one {Mentioning these {groupCount} groups exceeds the notification limit of # user.}
other {Mentioning these {groupCount} groups exceeds the notification limit of # users.}
}
}
other {}
}
}
}
That behavior is unexpected and makes it harder for translators to correctly translate ICU strings.
For your convenience, here’s a diff of the original and the copied string:
--- a/original.txt
+++ b/copy.txt
@@ -1,15 +1,15 @@
{ groupCount, plural,
- =1 {
+ one {}=1 {
{ isAdmin, select,
true {
{ notificationLimit, plural,
- one {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
+ one {}one {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
- one {Mentioning @{group1} exceeds the notification limit of # user.}
+ one {}one {Mentioning @{group1} exceeds the notification limit of # user.}
other {Mentioning @{group1} exceeds the notification limit of # users.}
}
}
@@ -20,13 +20,13 @@
{ isAdmin, select,
true {
{ notificationLimit, plural,
- one {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
+ one {}one {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # user.}
other {Mentioning @{group1} and @{group2} exceeds the <a href="{siteSettingUrl}" target="_blank">notification limit</a> of # users.}
}
}
false {
{ notificationLimit, plural,
- one {Mentioning @{group1} and @{group2} exceeds the notification limit of # user.}
+ one {}one {Mentioning @{group1} and @{group2} exceeds the notification limit of # user.}
other {Mentioning @{group1} and @{group2} exceeds the notification limit of # users.}
}
}