Page MenuHomePhabricator

Defragment i18n patchwork messages in SocialProfile
Open, Needs TriagePublic

Description

Some messages are currently fragmented; that is, they're built with string concatenation. To improve accuracy on these messages, we need to de-fragment these by merging them together.

Languages have varying word orders, and complex grammatical and syntactic rules. It's very hard to translate "lego" messages, that is messages formed by multiple pieces of text, possibly with some indirection (also called "string concatenation").
It is better to make every message a complete sentence, each with a full stop at the end. Several sentences can usually be combined much more easily be into a text block, if needed. When you want to combine several strings in one message, pass them in as parameters, as translators can order them correctly for their language when translating.

Messages that need de-fragmentation (all of the messages below should contain the $1 parameter inside the messages, not outside):

UserGifts/i18n/en.json
	"g-created-by": "created by",
UserProfile/i18n/en.json
	"user-recent-activity-edit": "Edited the page",
	"user-recent-activity-vote": "Voted for the page",
	"user-recent-activity-comment": "Commented on the page",
	"user-recent-activity-gift-sent": "Sent a gift to",
	"user-recent-activity-gift-rec": "Received a gift from",
	"user-recent-activity-friend": "Is now friends with",
	"user-recent-activity-foe": "Is now foes with",
	"user-recent-activity-user-message": "Sent a message to",
	"user-recent-activity-network-update": "Has posted a thought",
	"user-recent-system-gift": "Received an award",
NOTE: There's also this log action message (T146606) that needs de-fragmentation as well:
UserProfile/i18n/en.json
	"user-profile-update-log-section": "changed section",

This one might be a fragmented message:

UserStats/i18n/en.json
	"top-fans-points": "points",

Event Timeline

Change 389471 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Refactor the top-fans-points i18n message and its use cases a bit

https://gerrit.wikimedia.org/r/389471

Change 389471 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Refactor the top-fans-points i18n message and its use cases a bit

https://gerrit.wikimedia.org/r/389471

Amire80 renamed this task from Defragment i18n patchwork messages to Defragment i18n patchwork messages in SocialProfile.Feb 3 2018, 11:05 AM