Page MenuHomePhabricator

Make messages translatable for UserFeedback Gadget on MediaWiki.org
Closed, ResolvedPublic

Description

Previous task : T225584

Event Timeline

It depends what way should to be used for translations and what flaws there are. In gadgets most popular is updating gadget file (can also be separated file for translations).

Will do once https://www.mediawiki.org/wiki/Project:Requests/User_rights/DannyS712_2 is actioned (until then, I cannot edit the javascript file)

Okay, so I set up translations at https://www.mediawiki.org/wiki/User:DannyS712/userfeedback.js
The only complication I found was that within the "no" confirmation, when asking for feedback to be left on the talk page, there is a link embedded in the text. I split the message so that "talk page" is translated separately from the rest, so that mw.msg would work. Once there are translations for another language available to use, I'll sync the changes to the gadget.

Messages to translate
'userfeedback-question': 'Was this documentation helpful?',
'userfeedback-voteYes': 'Yes, it was helpful',
'userfeedback-voteNo': 'No, it was not helpful',
'userfeedback-confirmYes': 'Thank you for the feedback. We are glad that you found the documentation useful!',
'userfeedback-confirmNo': 'Thank you for the feedback. It would be helpful if you could leave some suggestions for improving the article on its $1.',
'userfeedback-confirmNoTalk': 'talk page',

@DannyS712: Heja! Could you explain why this sentence is split? Lego concatenation often leads to wrong translations.
'talk page' is not nominative but genitive case here but nobody can see that when looking at that isolated string.

	'userfeedback-confirmNo': 'Thank you for the feedback. It would be helpful if you could leave some suggestions for improving the article on its $1.',
	'userfeedback-confirmNoTalk': 'talk page',

@DannyS712: Heja! Could you explain why this sentence is split? Lego concatenation often leads to wrong translations.
'talk page' is not nominative but genitive case here but nobody can see that when looking at that isolated string.

	'userfeedback-confirmNo': 'Thank you for the feedback. It would be helpful if you could leave some suggestions for improving the article on its $1.',
	'userfeedback-confirmNoTalk': 'talk page',

To avoid including a link within the message text - I can combine them if that would be better

Wondering how to proceed here... Does @DannyS712 maybe need any input from @srishakatux ? Or anything else? :)

Wondering how to proceed here... Does @DannyS712 maybe need any input from @srishakatux ? Or anything else? :)

I'm waiting to have some translations before resolving

@DannyS712: Ah, I see. :) How to create / propose a translation?

For now, here is fine, or onwiki

Cannot add onwiki because nobody else can edit that page.

			de: {
				'userfeedback-question': 'War diese Dokumentation hilfreich?',
				'userfeedback-voteYes': 'Ja',
				'userfeedback-voteNo': 'Nein,
				'userfeedback-confirmYes': 'Danke für die Rückmeldung!',
				'userfeedback-confirmNo': 'Danke für die Rückmeldung! Bitte schlage auf der $1 vor wie man diesen Artikel verbessern könnte.',
				'userfeedback-confirmNoTalk': 'Diskussionsseite',
			}

PS: As I already said, translations will be broken if someone translated userfeedback-confirmNoTalk without having seen userfeedback-confirmNo before, as grammatical cases differ. I'd usually point people to https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sentences for more info.

Cannot add onwiki because nobody else can edit that page.

			de: {
				'userfeedback-question': 'War diese Dokumentation hilfreich?',
				'userfeedback-voteYes': 'Ja',
				'userfeedback-voteNo': 'Nein,
				'userfeedback-confirmYes': 'Danke für die Rückmeldung!',
				'userfeedback-confirmNo': 'Danke für die Rückmeldung! Bitte schlage auf der $1 vor wie man diesen Artikel verbessern könnte.',
				'userfeedback-confirmNoTalk': 'Diskussionsseite',
			}

PS: As I already said, translations will be broken if someone translated userfeedback-confirmNoTalk without having seen userfeedback-confirmNo before, as grammatical cases differ. I'd usually point people to https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sentences for more info.

True, but since translations are done within the file rather than in the translate extension, people should see it. Confirmed to work, deploying

@DannyS712 Directly using wgUserLanguage generates English text when one would not accept it, e.g. with the URL https://www.mediawiki.org/wiki/API:Main_page/de?uselang=de-at (requesting German, Austria); it should use the language fallback chain.