fix: sort localised keys generated by updateI18nKeysType

pull/2765/head
William Grant 12 months ago
parent 534080ddd7
commit 69a50cdcc8

@ -6,6 +6,7 @@ from os import path, listdir
from glob import glob
import json
import sys
from collections import OrderedDict
LOCALES_FOLDER = './_locales'
@ -16,10 +17,10 @@ LOCALIZED_KEYS_FILE = './ts/types/LocalizerKeys.ts'
stringToWrite = "export type LocalizerKeys =\n | "
with open(EN_FILE,'r') as jsonFile:
data = json.load(jsonFile)
keys = data.keys()
data = json.loads(jsonFile.read(), object_pairs_hook=OrderedDict)
keys = sorted(list(data.keys()))
stringToWrite += json.dumps(list(keys), sort_keys=True).replace(',', '\n |').replace('"', '\'')[1:-1]
stringToWrite += json.dumps(keys, sort_keys=True).replace(',', '\n |').replace('"', '\'')[1:-1]
stringToWrite += ';\n'

@ -1,14 +1,19 @@
export type LocalizerKeys =
| 'copyErrorAndQuit'
| 'unknown'
| 'databaseError'
| 'mainMenuFile'
| 'mainMenuEdit'
| 'mainMenuView'
| 'mainMenuWindow'
| 'mainMenuHelp'
| 'ByUsingThisService...'
| 'about'
| 'accept'
| 'activeMembers'
| 'add'
| 'addACaption'
| 'addAsModerator'
| 'addModerators'
| 'addingContacts'
| 'allUsersAreRandomly...'
| 'anonymous'
| 'answeredACall'
| 'appMenuHide'
| 'appMenuHideOthers'
| 'appMenuQuit'
| 'appMenuUnhide'
| 'appMenuQuit'
| 'editMenuUndo'
@ -91,154 +96,393 @@ export type LocalizerKeys =
| 'photo'
| 'cannotUpdate'
| 'cannotUpdateDetail'
| 'ok'
| 'cancel'
| 'changeAccountPasswordDescription'
| 'changeAccountPasswordTitle'
| 'changeNickname'
| 'changeNicknameMessage'
| 'changePassword'
| 'changePasswordInvalid'
| 'changePasswordTitle'
| 'changePasswordToastDescription'
| 'chooseAnAction'
| 'classicDarkThemeTitle'
| 'classicLightThemeTitle'
| 'clear'
| 'clearAll'
| 'clearAllConfirmationBody'
| 'clearAllConfirmationTitle'
| 'clearAllData'
| 'clearAllReactions'
| 'clearDataSettingsTitle'
| 'clearDevice'
| 'clearNickname'
| 'clickToTrustContact'
| 'close'
| 'closedGroupInviteFailMessage'
| 'closedGroupInviteFailMessagePlural'
| 'closedGroupInviteFailTitle'
| 'closedGroupInviteFailTitlePlural'
| 'closedGroupInviteOkText'
| 'closedGroupInviteSuccessMessage'
| 'closedGroupInviteSuccessTitle'
| 'closedGroupInviteSuccessTitlePlural'
| 'closedGroupMaxSize'
| 'confirmNewPassword'
| 'confirmPassword'
| 'connectToServerFail'
| 'connectToServerSuccess'
| 'connectingToServer'
| 'contactAvatarAlt'
| 'contactsHeader'
| 'contextMenuNoSuggestions'
| 'continue'
| 'error'
| 'continueYourSession'
| 'conversationsHeader'
| 'conversationsSettingsTitle'
| 'copiedToClipboard'
| 'copyErrorAndQuit'
| 'copyMessage'
| 'copyOpenGroupURL'
| 'copySessionID'
| 'couldntFindServerMatching'
| 'create'
| 'createAccount'
| 'createClosedGroupNamePrompt'
| 'createClosedGroupPlaceholder'
| 'createConversationNewContact'
| 'createConversationNewGroup'
| 'createGroup'
| 'createPassword'
| 'createSessionID'
| 'databaseError'
| 'debugLog'
| 'debugLogExplanation'
| 'decline'
| 'declineRequestMessage'
| 'delete'
| 'messageDeletionForbidden'
| 'deleteJustForMe'
| 'deleteAccountFromLogin'
| 'deleteAccountWarning'
| 'deleteContactConfirmation'
| 'deleteConversationConfirmation'
| 'deleteForEveryone'
| 'deleteMessagesQuestion'
| 'deleteJustForMe'
| 'deleteMessageQuestion'
| 'deleteMessages'
| 'deleteConversation'
| 'deleted'
| 'messageDeletedPlaceholder'
| 'destination'
| 'device'
| 'deviceOnly'
| 'dialogClearAllDataDeletionFailedDesc'
| 'dialogClearAllDataDeletionFailedMultiple'
| 'dialogClearAllDataDeletionFailedTitle'
| 'dialogClearAllDataDeletionFailedTitleQuestion'
| 'dialogClearAllDataDeletionQuestion'
| 'disabledDisappearingMessages'
| 'disappearingMessages'
| 'disappearingMessagesDisabled'
| 'displayName'
| 'displayNameEmpty'
| 'displayNameTooLong'
| 'documents'
| 'documentsEmptyState'
| 'done'
| 'downloadAttachment'
| 'editGroup'
| 'editGroupName'
| 'editMenuCopy'
| 'editMenuCut'
| 'editMenuDeleteContact'
| 'editMenuDeleteGroup'
| 'editMenuPaste'
| 'editMenuRedo'
| 'editMenuSelectAll'
| 'editMenuUndo'
| 'editProfileModalTitle'
| 'emptyGroupNameError'
| 'enable'
| 'endCall'
| 'enterAnOpenGroupURL'
| 'enterDisplayName'
| 'enterNewPassword'
| 'enterPassword'
| 'enterRecoveryPhrase'
| 'enterSessionID'
| 'enterSessionIDOfRecipient'
| 'enterSessionIDOrONSName'
| 'entireAccount'
| 'error'
| 'establishingConnection'
| 'expandedReactionsText'
| 'failedResolveOns'
| 'failedToAddAsModerator'
| 'failedToRemoveFromModerator'
| 'faq'
| 'fileSizeWarning'
| 'from'
| 'to'
| 'sent'
| 'received'
| 'sendMessage'
| 'getStarted'
| 'goToReleaseNotes'
| 'goToSupportPage'
| 'groupMembers'
| 'moreInformation'
| 'resend'
| 'deleteConversationConfirmation'
| 'clear'
| 'clearAllData'
| 'deleteAccountWarning'
| 'deleteAccountFromLogin'
| 'deleteContactConfirmation'
| 'quoteThumbnailAlt'
| 'groupNamePlaceholder'
| 'helpSettingsTitle'
| 'helpUsTranslateSession'
| 'hideBanner'
| 'hideMenuBarDescription'
| 'hideMenuBarTitle'
| 'hideRequestBanner'
| 'hideRequestBannerDescription'
| 'iAmSure'
| 'imageAttachmentAlt'
| 'videoAttachmentAlt'
| 'lightboxImageAlt'
| 'imageCaptionIconAlt'
| 'addACaption'
| 'copySessionID'
| 'copyOpenGroupURL'
| 'save'
| 'saveLogToDesktop'
| 'saved'
| 'tookAScreenshot'
| 'savedTheFile'
| 'linkPreviewsTitle'
| 'incomingCallFrom'
| 'incomingError'
| 'invalidGroupNameTooLong'
| 'invalidGroupNameTooShort'
| 'invalidNumberError'
| 'invalidOldPassword'
| 'invalidOpenGroupUrl'
| 'invalidPassword'
| 'invalidPubkeyFormat'
| 'invalidSessionId'
| 'inviteContacts'
| 'join'
| 'joinACommunity'
| 'joinOpenGroup'
| 'joinOpenGroupAfterInvitationConfirmationDesc'
| 'joinOpenGroupAfterInvitationConfirmationTitle'
| 'joinedTheGroup'
| 'keepDisabled'
| 'kickedFromTheGroup'
| 'learnMore'
| 'leaveAndRemoveForEveryone'
| 'leaveGroup'
| 'leaveGroupConfirmation'
| 'leaveGroupConfirmationAdmin'
| 'leftTheGroup'
| 'lightboxImageAlt'
| 'linkDevice'
| 'linkPreviewDescription'
| 'linkPreviewsConfirmMessage'
| 'mediaPermissionsTitle'
| 'mediaPermissionsDescription'
| 'spellCheckTitle'
| 'spellCheckDescription'
| 'spellCheckDirty'
| 'readReceiptSettingDescription'
| 'readReceiptSettingTitle'
| 'typingIndicatorsSettingDescription'
| 'typingIndicatorsSettingTitle'
| 'zoomFactorSettingTitle'
| 'themesSettingTitle'
| 'primaryColor'
| 'primaryColorGreen'
| 'primaryColorBlue'
| 'primaryColorYellow'
| 'primaryColorPink'
| 'primaryColorPurple'
| 'primaryColorOrange'
| 'primaryColorRed'
| 'classicDarkThemeTitle'
| 'classicLightThemeTitle'
| 'oceanDarkThemeTitle'
| 'oceanLightThemeTitle'
| 'pruneSettingTitle'
| 'pruneSettingDescription'
| 'enable'
| 'keepDisabled'
| 'notificationSettingsDialog'
| 'nameAndMessage'
| 'noNameOrMessage'
| 'nameOnly'
| 'newMessage'
| 'createConversationNewContact'
| 'createConversationNewGroup'
| 'joinACommunity'
| 'chooseAnAction'
| 'newMessages'
| 'notificationMostRecentFrom'
| 'notificationFrom'
| 'notificationMostRecent'
| 'sendFailed'
| 'linkPreviewsTitle'
| 'linkVisitWarningMessage'
| 'linkVisitWarningTitle'
| 'loading'
| 'mainMenuEdit'
| 'mainMenuFile'
| 'mainMenuHelp'
| 'mainMenuView'
| 'mainMenuWindow'
| 'markAllAsRead'
| 'maxPasswordAttempts'
| 'maximumAttachments'
| 'media'
| 'mediaEmptyState'
| 'mediaMessage'
| 'messageBodyMissing'
| 'messageBody'
| 'unblockToSend'
| 'unblockGroupToSend'
| 'youChangedTheTimer'
| 'timerSetOnSync'
| 'mediaPermissionsDescription'
| 'mediaPermissionsTitle'
| 'members'
| 'message'
| 'messageBody'
| 'messageBodyMissing'
| 'messageDeletedPlaceholder'
| 'messageDeletionForbidden'
| 'messageRequestAccepted'
| 'messageRequestAcceptedOurs'
| 'messageRequestAcceptedOursNoName'
| 'messageRequestPending'
| 'messageRequests'
| 'messagesHeader'
| 'moreInformation'
| 'multipleJoinedTheGroup'
| 'multipleKickedFromTheGroup'
| 'multipleLeftTheGroup'
| 'mustBeApproved'
| 'nameAndMessage'
| 'nameOnly'
| 'newMessage'
| 'newMessages'
| 'next'
| 'nicknamePlaceholder'
| 'noAudioInputFound'
| 'noAudioOutputFound'
| 'noBlockedContacts'
| 'noCameraFound'
| 'noContactsForGroup'
| 'noContactsToAdd'
| 'noGivenPassword'
| 'noMediaUntilApproved'
| 'noMembersInThisGroup'
| 'noMessageRequestsPending'
| 'noModeratorsToRemove'
| 'noNameOrMessage'
| 'noSearchResults'
| 'noteToSelf'
| 'notificationForConvo'
| 'notificationForConvo_all'
| 'notificationForConvo_disabled'
| 'notificationForConvo_mentions_only'
| 'notificationFrom'
| 'notificationMostRecent'
| 'notificationMostRecentFrom'
| 'notificationPreview'
| 'notificationSettingsDialog'
| 'notificationSubtitle'
| 'notificationsSettingsContent'
| 'notificationsSettingsTitle'
| 'oceanDarkThemeTitle'
| 'oceanLightThemeTitle'
| 'offline'
| 'ok'
| 'oneNonImageAtATimeToast'
| 'onionPathIndicatorDescription'
| 'onionPathIndicatorTitle'
| 'onlyAdminCanRemoveMembers'
| 'onlyAdminCanRemoveMembersDesc'
| 'open'
| 'openGroupInvitation'
| 'openGroupURL'
| 'openMessageRequestInbox'
| 'openMessageRequestInboxDescription'
| 'or'
| 'orJoinOneOfThese'
| 'originalMessageNotFound'
| 'otherPlural'
| 'otherSingular'
| 'password'
| 'passwordCharacterError'
| 'passwordLengthError'
| 'passwordTypeError'
| 'passwordViewTitle'
| 'passwordsDoNotMatch'
| 'permissionsSettingsTitle'
| 'photo'
| 'pickClosedGroupMember'
| 'pinConversation'
| 'pleaseWaitOpenAndOptimizeDb'
| 'previewThumbnail'
| 'primaryColor'
| 'primaryColorBlue'
| 'primaryColorGreen'
| 'primaryColorOrange'
| 'primaryColorPink'
| 'primaryColorPurple'
| 'primaryColorRed'
| 'primaryColorYellow'
| 'privacySettingsTitle'
| 'pruneSettingDescription'
| 'pruneSettingTitle'
| 'publicChatExists'
| 'quoteThumbnailAlt'
| 'rateLimitReactMessage'
| 'reactionListCountPlural'
| 'reactionListCountSingular'
| 'reactionNotification'
| 'reactionPopup'
| 'reactionPopupMany'
| 'reactionPopupOne'
| 'reactionPopupThree'
| 'reactionPopupTwo'
| 'readReceiptSettingDescription'
| 'readReceiptSettingTitle'
| 'received'
| 'recoveryPhrase'
| 'recoveryPhraseEmpty'
| 'recoveryPhraseRevealButtonText'
| 'recoveryPhraseRevealMessage'
| 'recoveryPhraseSavePromptMain'
| 'recoveryPhraseSecureTitle'
| 'remove'
| 'removeAccountPasswordDescription'
| 'removeAccountPasswordTitle'
| 'removeFromModerators'
| 'removeModerators'
| 'removePassword'
| 'removePasswordInvalid'
| 'removePasswordTitle'
| 'removePasswordToastDescription'
| 'removeResidueMembers'
| 'replyToMessage'
| 'replyingToMessage'
| 'reportIssue'
| 'requestsPlaceholder'
| 'requestsSubtitle'
| 'resend'
| 'respondingToRequestWarning'
| 'restoreUsingRecoveryPhrase'
| 'ringing'
| 'save'
| 'saveLogToDesktop'
| 'saved'
| 'savedTheFile'
| 'searchFor...'
| 'searchForContactsOnly'
| 'selectMessage'
| 'sendFailed'
| 'sendMessage'
| 'sendRecoveryPhraseMessage'
| 'sendRecoveryPhraseTitle'
| 'sent'
| 'sessionMessenger'
| 'setAccountPasswordDescription'
| 'setAccountPasswordTitle'
| 'setDisplayPicture'
| 'setPassword'
| 'setPasswordFail'
| 'setPasswordInvalid'
| 'setPasswordTitle'
| 'setPasswordToastDescription'
| 'settingsHeader'
| 'shareBugDetails'
| 'show'
| 'showDebugLog'
| 'showRecoveryPhrase'
| 'showRecoveryPhrasePasswordRequest'
| 'showUserDetails'
| 'spellCheckDescription'
| 'spellCheckDirty'
| 'spellCheckTitle'
| 'stagedImageAttachment'
| 'stagedPreviewThumbnail'
| 'startConversation'
| 'startInTrayDescription'
| 'startInTrayTitle'
| 'startNewConversationBy...'
| 'startedACall'
| 'support'
| 'surveyTitle'
| 'themesSettingTitle'
| 'theyChangedTheTimer'
| 'thisMonth'
| 'thisWeek'
| 'timerOption_0_seconds'
| 'timerOption_5_seconds'
| 'timerOption_0_seconds_abbreviated'
| 'timerOption_10_seconds'
| 'timerOption_30_seconds'
| 'timerOption_1_minute'
| 'timerOption_5_minutes'
| 'timerOption_30_minutes'
| 'timerOption_1_hour'
| 'timerOption_6_hours'
| 'timerOption_10_seconds_abbreviated'
| 'timerOption_12_hours'
| 'timerOption_12_hours_abbreviated'
| 'timerOption_1_day'
| 'timerOption_1_day_abbreviated'
| 'timerOption_1_hour'
| 'timerOption_1_hour_abbreviated'
| 'timerOption_1_minute'
| 'timerOption_1_minute_abbreviated'
| 'timerOption_1_week'
| 'timerOption_1_week_abbreviated'
| 'timerOption_2_weeks'
| 'disappearingMessages'
| 'changeNickname'
| 'clearNickname'
| 'nicknamePlaceholder'
| 'changeNicknameMessage'
| 'timerOption_0_seconds_abbreviated'
| 'timerOption_5_seconds_abbreviated'
| 'timerOption_10_seconds_abbreviated'
| 'timerOption_2_weeks_abbreviated'
| 'timerOption_30_minutes'
| 'timerOption_30_minutes_abbreviated'
| 'timerOption_30_seconds'
| 'timerOption_30_seconds_abbreviated'
| 'timerOption_1_minute_abbreviated'
| 'timerOption_5_minutes'
| 'timerOption_5_minutes_abbreviated'
| 'timerOption_30_minutes_abbreviated'
| 'timerOption_1_hour_abbreviated'
| 'timerOption_5_seconds'
| 'timerOption_5_seconds_abbreviated'
| 'timerOption_6_hours'
| 'timerOption_6_hours_abbreviated'
| 'timerOption_12_hours_abbreviated'
| 'timerOption_1_day_abbreviated'
| 'timerOption_1_week_abbreviated'
| 'timerOption_2_weeks_abbreviated'
| 'disappearingMessagesDisabled'
| 'disabledDisappearingMessages'
| 'youDisabledDisappearingMessages'
| 'timerSetOnSync'
| 'timerSetTo'
| 'noteToSelf'
| 'hideMenuBarTitle'
| 'hideMenuBarDescription'
| 'startConversation'
| 'invalidNumberError'
| 'failedResolveOns'
| 'autoUpdateSettingTitle'
| 'autoUpdateSettingDescription'
| 'autoUpdateNewVersionTitle'
| 'autoUpdateNewVersionMessage'
| 'autoUpdateNewVersionInstructions'
| 'autoUpdateRestartButtonLabel'
| 'autoUpdateLaterButtonLabel'
| 'autoUpdateDownloadButtonLabel'
| 'autoUpdateDownloadedMessage'
| 'autoUpdateDownloadInstructions'
| 'leftTheGroup'
| 'multipleLeftTheGroup'
| 'updatedTheGroup'
| 'titleIsNow'
| 'joinedTheGroup'
| 'multipleJoinedTheGroup'
@ -247,144 +491,15 @@ export type LocalizerKeys =
| 'block'
| 'unblock'
| 'unblocked'
| 'blocked'
| 'blockedSettingsTitle'
| 'conversationsSettingsTitle'
| 'unbanUser'
| 'userUnbanned'
| 'userUnbanFailed'
| 'banUser'
| 'banUserAndDeleteAll'
| 'userBanned'
| 'userBanFailed'
| 'leaveGroup'
| 'leaveAndRemoveForEveryone'
| 'leaveGroupConfirmation'
| 'leaveGroupConfirmationAdmin'
| 'cannotRemoveCreatorFromGroup'
| 'cannotRemoveCreatorFromGroupDesc'
| 'noContactsForGroup'
| 'failedToAddAsModerator'
| 'failedToRemoveFromModerator'
| 'copyMessage'
| 'selectMessage'
| 'editGroup'
| 'editGroupName'
| 'unknown'
| 'unknownCountry'
| 'unpinConversation'
| 'unreadMessages'
| 'updateGroupDialogTitle'
| 'showRecoveryPhrase'
| 'yourSessionID'
| 'setAccountPasswordTitle'
| 'setAccountPasswordDescription'
| 'changeAccountPasswordTitle'
| 'changeAccountPasswordDescription'
| 'removeAccountPasswordTitle'
| 'removeAccountPasswordDescription'
| 'enterPassword'
| 'confirmPassword'
| 'enterNewPassword'
| 'confirmNewPassword'
| 'showRecoveryPhrasePasswordRequest'
| 'recoveryPhraseSavePromptMain'
| 'invalidOpenGroupUrl'
| 'copiedToClipboard'
| 'passwordViewTitle'
| 'password'
| 'setPassword'
| 'changePassword'
| 'createPassword'
| 'removePassword'
| 'maxPasswordAttempts'
| 'typeInOldPassword'
| 'invalidOldPassword'
| 'invalidPassword'
| 'noGivenPassword'
| 'passwordsDoNotMatch'
| 'setPasswordInvalid'
| 'changePasswordInvalid'
| 'removePasswordInvalid'
| 'setPasswordTitle'
| 'changePasswordTitle'
| 'removePasswordTitle'
| 'setPasswordToastDescription'
| 'changePasswordToastDescription'
| 'removePasswordToastDescription'
| 'publicChatExists'
| 'connectToServerFail'
| 'connectingToServer'
| 'connectToServerSuccess'
| 'setPasswordFail'
| 'passwordLengthError'
| 'passwordTypeError'
| 'passwordCharacterError'
| 'remove'
| 'invalidSessionId'
| 'invalidPubkeyFormat'
| 'emptyGroupNameError'
| 'editProfileModalTitle'
| 'groupNamePlaceholder'
| 'inviteContacts'
| 'addModerators'
| 'removeModerators'
| 'addAsModerator'
| 'removeFromModerators'
| 'add'
| 'addingContacts'
| 'noContactsToAdd'
| 'noMembersInThisGroup'
| 'noModeratorsToRemove'
| 'onlyAdminCanRemoveMembers'
| 'onlyAdminCanRemoveMembersDesc'
| 'createAccount'
| 'startInTrayTitle'
| 'startInTrayDescription'
| 'yourUniqueSessionID'
| 'allUsersAreRandomly...'
| 'getStarted'
| 'createSessionID'
| 'recoveryPhrase'
| 'enterRecoveryPhrase'
| 'displayName'
| 'anonymous'
| 'removeResidueMembers'
| 'enterDisplayName'
| 'continueYourSession'
| 'linkDevice'
| 'restoreUsingRecoveryPhrase'
| 'or'
| 'ByUsingThisService...'
| 'beginYourSession'
| 'welcomeToYourSession'
| 'searchFor...'
| 'searchForContactsOnly'
| 'enterSessionID'
| 'enterSessionIDOfRecipient'
| 'message'
| 'appearanceSettingsTitle'
| 'privacySettingsTitle'
| 'notificationsSettingsTitle'
| 'audioNotificationsSettingsTitle'
| 'notificationsSettingsContent'
| 'notificationPreview'
| 'recoveryPhraseEmpty'
| 'displayNameEmpty'
| 'displayNameTooLong'
| 'members'
| 'activeMembers'
| 'join'
| 'joinOpenGroup'
| 'createGroup'
| 'create'
| 'createClosedGroupNamePrompt'
| 'createClosedGroupPlaceholder'
| 'openGroupURL'
| 'enterAnOpenGroupURL'
| 'next'
| 'invalidGroupNameTooShort'
| 'invalidGroupNameTooLong'
| 'pickClosedGroupMember'
| 'closedGroupMaxSize'
| 'noBlockedContacts'
| 'updatedTheGroup'
| 'userAddedToModerators'
| 'userBanFailed'
| 'userBanned'
| 'userRemovedFromModerators'
| 'orJoinOneOfThese'
| 'helpUsTranslateSession'

Loading…
Cancel
Save