Page MenuHomePhabricator

Remove unused i18n definitions in WikiLambda
Closed, ResolvedPublic

Description

If I am not wrong, any translation keys being only found in the i18n/ folder and in the extension.json are unsused ones and are probably worth to be removed.

I ran the following bash command to detect them (requires jq):
jq -r 'keys | map(select(startswith("wikilambda-"))) | .[]' i18n/en.json | xargs -i% bash -c 'fgrep -q --exclude-dir="i18n" --exclude="extension.json" -R "%" || echo "%"' | grep -v "wikilambda-desc"

Explanation for jq:

  • keys extracts all keys of the root objects and return them as an array
  • | works like a pipe
  • map(select(startswith("wikilambda-"))) iterate over each key and only select those which are strings begining with "wikilambda-"
  • .[] transforms the array into a series of string (separated with newlines, so xargs can execute the command for each of them)

I detail more the command upon your request.

So I detected that the following keys are unused:

wikilambda-editor-attach-title
wikilambda-editor-behavior-subtitle
wikilambda-editor-behavior-title
wikilambda-editor-fn-step-define
wikilambda-editor-fn-step-implement
wikilambda-editor-fn-step-implementations
wikilambda-editor-fn-step-tests
wikilambda-editor-fn-tests-tooltip-content
wikilambda-editor-fn-tests-tooltip-header
wikilambda-editor-go-back-button
wikilambda-editor-input-add-button
wikilambda-editor-input-description
wikilambda-editor-input-subtitle
wikilambda-editor-name-aliases
wikilambda-editor-name-aliases-description
wikilambda-editor-name-aliases-placeholder
wikilambda-editor-name-subtitle
wikilambda-editor-name-title
wikilambda-editor-name-zobject-name
wikilambda-editor-name-zobject-name-description
wikilambda-editor-name-zobject-name-placeholder
wikilambda-editor-next-button
wikilambda-editor-output-description
wikilambda-editor-output-placeholder
wikilambda-editor-output-subtitle
wikilambda-editor-progress-percentage
wikilambda-editor-progress-title
wikilambda-editor-steps-label
wikilambda-editor-write-save-button
wikilambda-editor-write-subtitle
wikilambda-editor-write-title
wikilambda-emptylabel
wikilambda-function-definition-footer-implementation-button
wikilambda-function-definition-inputs-item-selector-search-placeholder
wikilambda-function-definition-publish-successful-message
wikilambda-functioncall-error-category-desc
wikilambda-functioncall-error-nonfunction-category-desc
wikilambda-functioncall-error-nonstringinput-category-desc
wikilambda-functioncall-error-nonstringoutput-category-desc
wikilambda-functioncall-error-unknown-category-desc
wikilambda-persistentobject-function-signature-label
wikilambda-persistentzobject-metadata
wikilambda-prohibitedcreationtype
wikilambda-published
wikilambda-special-callfunction
wikilambda-special-callfunction-intro
wikilambda-special-callfunction-nojs
wikilambda-special-callfunction-summary
wikilambda-special-createzobject-summary
wikilambda-special-edit-function-definition-title
wikilambda-special-function-definition-title
wikilambda-tester-failure-actual
wikilambda-tester-failure-expected
wikilambda-ztyped-list-description
wikilambda-ztyped-list-items
wikilambda-ztyped-list-placeholder

I propose to remove these keys.

Event Timeline

Change 842449 had a related patch set uploaded (by Teleosteen; author: Teleosteen):

[mediawiki/extensions/WikiLambda@master] Remove unused translation keys

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

Change 842910 had a related patch set uploaded (by Teleosteen; author: Teleosteen):

[mediawiki/extensions/WikiLambda@master] Remove unused translation keys

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

Change 842449 abandoned by Teleosteen:

[mediawiki/extensions/WikiLambda@master] Remove unused translation keys

Reason:

Please see this gerrit ticket: 842910

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

Change 842910 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] i18n: Remove 51 unused translation keys

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

Jdforrester-WMF renamed this task from Remove unused translations to Remove unused i18n definitions in WikiLambda.Oct 17 2022, 2:43 PM
Jdforrester-WMF closed this task as Resolved.