Page MenuHomePhabricator

Remove unused message keys from MobileFrontend
Closed, ResolvedPublic0.5 Story Points

Description

Using a script with silver searcher (see below) you can find keys that are not referred to in resources or includes folders.
They are the following keys:

  • mobile-frontend-pageaction-upload-tooltip
  • mobile-frontend-quick-lookup-not-internal
  • mobile-frontend-quick-lookup-no-results
  • mobile-frontend-quick-lookup-looking
  • mobile-frontend-watchlist-view
  • mobile-frontend-thanked-notice
  • mobile-frontend-sign-up-heading
  • mobile-frontend-sign-in-why
  • mobile-frontend-sign-in-heading
  • mobile-frontend-sign-in-error-heading
  • mobile-frontend-search-submit
  • mobile-frontend-saving-exit-page
  • mobile-frontend-regular-site
  • mobile-frontend-placeholder-app
  • mobile-frontend-photo-caption-placeholder
  • mobile-frontend-photo-article-edit-comment
  • mobile-frontend-photo-article-donate-comment
  • mobile-frontend-password-placeholder
  • mobile-frontend-password-confirm-placeholder
  • mobile-frontend-password
  • mobile-frontend-page-menu-language-current
  • mobile-frontend-page-menu-history
  • mobile-frontend-page-menu-contents
  • mobile-frontend-low-res-explain
  • mobile-frontend-nearby-sectiontext
  • mobile-frontend-main-menu-featured
  • mobile-frontend-main-menu-account-create
  • mobile-frontend-main-menu-back
  • mobile-frontend-logged-in-toast-notification
  • mobile-frontend-lead-image-tutorial-summary
  • mobile-frontend-lead-image-tutorial-confirm
  • mobile-frontend-last-modified-years
  • mobile-frontend-last-modified-seconds
  • mobile-frontend-last-modified-months
  • mobile-frontend-last-modified-minutes
  • mobile-frontend-last-modified-just-now
  • mobile-frontend-last-modified-hours
  • mobile-frontend-last-modified-days
  • mobile-frontend-image-uploading
  • mobile-frontend-image-heading-describe
  • mobile-frontend-image-cancel-confirm
  • mobile-frontend-footer-contact
  • mobile-frontend-first-upload-wizard-new-page-3-ok
  • mobile-frontend-first-upload-wizard-new-page-3-header
  • mobile-frontend-first-upload-wizard-new-page-2-header
  • mobile-frontend-first-upload-wizard-new-page-2
  • mobile-frontend-first-upload-wizard-new-page-1-header
  • mobile-frontend-first-upload-wizard-new-page-1
  • mobile-frontend-enable-images
  • mobile-frontend-editor-newpage-prompt
  • mobile-frontend-drawer-cancel
  • mobile-frontend-donate-image-signup-action
  • mobile-frontend-donate-image-heading
  • mobile-frontend-dismiss-notification
  • mobile-frontend-disable-images
  • mobile-frontend-diffview-explained
  • mobile-frontend-current-language
  • mobile-frontend-contribution-summary
  • mobile-frontend-changeslist-ip
  • mobile-frontend-back-to-top-of-section
  • mobile-frontend-app-title
  • mobile-frontend-account-create-submit
  • mobile-frontend-account-create-email-placeholder

they should all be removed.

var fs = require('fs');
var exec = require('child_process').exec;
var en = JSON.parse(fs.readFileSync('i18n/en.json', 'utf8'));
Object.keys(en).forEach((key) => {
	var cmd = `ag ${key} includes/ resources/ extension.json`;
	if (
		key.indexOf( 'apihelp-' ) !== 0 &&
		key !== 'skinname-minerva' &&
		key.indexOf( 'tag-' ) !== 0 &&
		key.indexOf( 'abusefilter-edit-builder-vars-' ) !== 0 &&
		key.indexOf('@') !== 0
	) {
		exec(cmd, function(error, stdout, stderr) {
			if ( !stdout && !stderr )
			console.log(`* ${key}`);
		});
	}
} );

Event Timeline

Jdlrobson created this task.Feb 9 2017, 9:41 PM
Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptFeb 9 2017, 9:41 PM
Restricted Application added a subscriber: TerraCodes. ยท View Herald TranscriptFeb 9 2017, 11:56 PM
bmansurov triaged this task as Normal priority.Feb 17 2017, 3:57 PM
MtDu claimed this task.Feb 18 2017, 8:11 PM
MtDu added a subscriber: MtDu.

I'll try to finish this up.

Change 338543 had a related patch set uploaded (by MtDu):
Remove unused message keys from MobileFrontEnd.

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

@MtDu any updates on the patch?

MtDu added a comment.Feb 24 2017, 2:22 AM

@bmansurov
I'll try to get to it this weekend. Feel free to work on it if you have time.

Hi @MtDu please remove this tag when you need us to look at the patch again. No rush - we'll poke you again if we need to fix this more urgently!

Change 338543 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend] Remove unused message keys from MobileFrontEnd.

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

Jdlrobson closed this task as Resolved.Mar 14 2017, 11:06 PM

Signing off!

Jdlrobson set the point value for this task to 0.5.Mar 14 2017, 11:07 PM