Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all unused translation keys #17813

Open
akatov opened this issue Nov 3, 2023 · 2 comments
Open

Remove all unused translation keys #17813

akatov opened this issue Nov 3, 2023 · 2 comments

Comments

@akatov
Copy link
Contributor

akatov commented Nov 3, 2023

Problem

#17610 introduced linting of the usage of translation keys in i18n/label expressions through clj-kondo. #17735 created a script to find missing, probably non-namespaced, and probably unused translation keys. Since there were so many of the latter two, their removal/fixing was extracted to separate issues.

In particular, there are 364 probably unused translation keys in translations/en.json that we would like to remove (and probably remove them from other translation files as well).

List of keys

Here are the keys in translation/en.json that are most likely not used inside src:

NFT
about-sharing-data
accept-and-add
accept-and-continue
accept-and-share-address
accept-community-rules
accept-status-tos-prefix
access-existing-keys
active-members
add-text
add-to-contacts-text
address-received
address-request-accepted
address-requested
advertiser-description
advertiser-starter-pack-accept
advertiser-starter-pack-decline
advertiser-starter-pack-description
advertiser-starter-pack-title
advertiser-title
allow-and-send
alphabetically
app-connections
approve-token-contract-desc
apr
are-you-sure-to-cancel
attribution-received
audio-recorder
audio-recorder-max-ms-reached
aug
back-up
biometric-disable-bioauth
biometric-disable-password-description
biometric-disable-password-title
biometric-enable
biometric-enable-keycard
biometric-secure-with
bip39-password-placeholder
blank-contacts-text
blank-messages-text
build-yourself
buy-crypto-description
buy-crypto-title
cannot-pin-desc
cannot-pin-title
cant-open-public-chat
category-title
chat-and-transact
chat-is-a-contact
chat-is-not-a-contact
chat-notification-preferences
choose-actions
choose-new-location-for-keystore
choose-storage
clear-all
cleared-chat-description-public
close-contact-search
communities-alpha
communities-enabled
community-channel-read-requirements-met
community-channel-read-requirements-not-met
community-channel-write-requirements-met
community-channel-write-requirements-not-met
community-color-placeholder
community-edit-title
community-emoji-thumbnail-title
community-enter-channel-info
community-image-delete
community-info-not-found
community-invite-title
community-join-requirements-changed
community-join-requirements-met
community-join-requirements-not-met
community-join-requirements-tokens-lost
community-link
community-private-key
community-requests-to-join-title
community-roles
confirm-password-placeholder
connect-with-users
contact-request-header
contact-request-sent-to
contacts-descr
create-category
create-channel
create-channel-title
current-average-tip
current-base
custom-seed-phrase
custom-seed-phrase-text-1
dapp-starter-pack-accept
dapp-starter-pack-description
dapp-starter-pack-title
data-collected
data-collected-subtitle
database-reset-warning
dec
delete-category-confirmation
describe-channel
duration-estimate
edit-categories
edit-channel-title
edit-chats
edit-community
edit-name-image
emoji-recent
empty-activity-center
empty-chat-description-community
empty-keycard-required
empty-notifications-subtitle-read
empty-notifications-subtitle-unread
empty-notifications-title-read
ens-dismiss-message
ensure-qr-code-in-focus-to-scan
enter-channel
enter-password-migration-prompt
enter-recipient-address-or-username
enter-watch-account-address
error-syncing-connection-failed
expand-all
feb
fetch-community
fetch-timeline
fetching-community
follow
follow-your-interests
fri
generate-scan-sync-code
get-a-keycard
give-a-short-description
give-permissions-camera
group-invite-link
group-membership-request
help-improve-status
how-it-works
how-to-scan
http-gateway-error
incoming-transaction
instruction-after-qr-generated
invalid-public-chat-topic
invalid-username-or-key
invite-button
invite-chat-accept
invite-chat-accept-join
invite-chat-intro
invite-chat-name
invite-chat-pending
invite-chat-rule
invite-chat-starter-pack
invite-contacts
invite-friends-and-family
invite-instruction-fifth
invite-instruction-first
invite-instruction-fourth
invite-instruction-second
invite-instruction-third
invite-privacy-policy-public
invite-privacy-policy1
invite-privacy-policy2
invite-public-chat-home
invite-public-chat-intro
invite-receive-account
invite-reward
invite-reward-friend
invite-reward-friend-description
invite-reward-friend-name
invite-reward-you
invite-reward-you-description
invite-reward-you-name
invite-select-account
invite-warning
jan
join
join-a-community
join-new-private-chat
join-new-public-chat
jul
jun
key-managment
key-on-device
keycard-upsell-subtitle
load-more-timeline
local-pairing-experimental-mode
lock-app-with
logout-key-management
looking-for-cards
lower-than-average-tip
manage-keys-and-storage
mar
mark-user-untrustworthy
master-account
may
members-label
membership-description
membership-ens
membership-ens-description
membership-invite
membership-invite-description
membership-none
membership-none-placeholder
membership-request-denied
membership-request-pending
migration-successful
migration-successful-text
mo
mon
move-and-reset
move-keystore-file
move-keystore-file-to-keycard
mutal-contacts
mutual-contact-requests
my-status
name-your-channel
name-your-channel-placeholder
new-category
new-messages-header
new-status
new-ui
no-thanks
non-contacts
not-registered
notifications-servers
notifications-switch
nov
oct
ok-save-pass
open-chat
open-home
open-membership
optimal
outgoing-transaction
pair-devices
password-placeholder
pending-invitations
pinned-messages-2
pinned-messages-count
pinned-messages-empty
private-notifications
private-notifications-descr
profile-details
profile-not-found
public-channel
public-chat-description
push-notifications-server-enabled
push-notifications-servers
rearrange-categories
received
recover-with-seed-phrase
redeem-amount
redeem-now
redeem-success
reduced-tip
refresh
registered
reject-and-delete
remote-notifications
remote-notifications-subtitle
remove-from-contacts-text
remove-group
removed-from-contacts
replying-to
request-feature
request-membership
request-pending
request-processed-after-node-online
requesting
reset-database-warning
rpc-usage-get-stats
sa
safe-estimate
sat
say-hi
search-contacts
search-discover-communities
search-no-chat-found
see-sticker-set
see-suggestions
seed-key-uid-mismatch
seed-key-uid-mismatch-desc-1
seed-key-uid-mismatch-desc-2
select-new-location-for-keys
send-contact-request-message
send-push-notifications
send-push-notifications-description
sep
server
shared
sharing-data-desc-1
sharing-data-desc-2
sharing-data-desc-3
sharing-data-desc-4
sharing-data-desc-5
sharing-data-desc-6
show-existing-keys
sign transactions
sign-and-send
skip
slide-to-sign
sort-communities
specify-server-public-key
starter-pack-coming
starter-pack-coming-description
starter-pack-received
starter-pack-received-description
status-is-open-source
status-updates-descr
statuses-descr
statuses-my-status-descr
su
sun
sync-devices-result-sub-title
synced-devices
tap-card-again
th
thank-you
thu
timeline
to-enable-biometric
token-price
total-members
transaction-declined
transaction-signed
transfer-ma-unknown-error-desc-1
transfer-ma-unknown-error-desc-2
try-keeping-the-card-still
try-your-luck-again
tu
tue
unlimited
until
update-to-see-image
updates-to-tos
updates-to-tos-desc
user-sent-a-gif
view-data
view-pinned-messages
view-public-dashboard
view-rules
vote-to-feature
wallet-connect-2.0
wallet-connect-app-connected
wallet-connect-go-back
wallet-connect-proposal-description
wc-brand-guide
wc-disclaimer
wc-dispute
wc-how-to-use-status-app
wc-new-tos-based-on-principles-prefix
we
wed
welcome-blank-community-message
welcome-blank-message
welcome-community-blank-message
welcome-community-blank-message-edit-chats
what-changed
what-is-shared
whats-on-your-mind
who-are-you-looking-for
you-colon
you-dont-have-contacts-invite-friends
you-must-always-hold
you-must-now-hold
you-will-start-from-scratch
your-keys

Implementation

Uncomment the relevant expressions in scripts/lint_translations.clj, in particular the line to print out the unused translation keys, or simply use the list above.

Remove them from translations/en.json and probably from other translation files as well.

Notes

  • Translation keys in src can theoretically be generated at runtime (e.g. using keyword), and, if we're not careful, we may by accident remove a key that's actually needed.
  • There may be translation keys (like months, weekdays, etc.) that are currently not used inside src, but which we may still want to keep around.
    These problems should be addressed once this issue is worked on.

Future Steps

Once actually unused keywords have been removed, and all invocations of i18n/label have been fixed to only use keywords namespaced with t:/, then the translation lint script returning an "unused translation keyword" would probably mean that the translation key has been misspelled inside tranlsations/en.json, and we may want to adjust the warning.

@J-Son89
Copy link
Contributor

J-Son89 commented Jan 26, 2024

@ilmotta - I can't recall - is this issue already handled?

@ilmotta
Copy link
Contributor

ilmotta commented Jan 26, 2024

@ilmotta - I can't recall - is this issue already handled?

@J-Son89, I think this issue is still valuable. The lint/translation.clj script still contains instructions about how to analyze and eliminate remaining unused translations. But we may prefer to close this issue because I don't see core contributors working on this anytime soon, unless we want to keep it open for external contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants