Files
my_openplace/rename-i18n-variables.js
zack3d 785032a8ad fix(plugins): respect USE_FRONTEND_BACKUP and create plugins dir
Resolve plugin directory based on USE_FRONTEND_BACKUP so /api/plugins
works with both frontend-backup and built frontend, aligning with
index.ts.

Ensure /app/frontend/plugins is created during non-backup Docker
builds to avoid missing-directory issues at runtime.

Update backup asset import reference and adjust local helper
script path.
2025-10-04 16:48:59 -07:00

405 lines
16 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const filePath = 'f:\\place\\FurryPlace\\frontend-backup\\_app\\immutable\\nodes\\4.CrDfIbdR.js';
// Read the file
let content = fs.readFileSync(filePath, 'utf8');
// Define all the minified variables and their replacements
const replacements = [
// Lines already done - skip these
// { old: 'Sb', new: 'Offline_STR' },
// { old: 'Mb', new: 'ZoomInToSeePixels_STR' },
// ... (already done)
// Remaining minified variables from lines 247-848
{ old: 'L2', new: 'AddProfilePicture_STR' },
{ old: 'gp', new: 'NotEnoughDroplets_STR' },
{ old: 'O2', new: 'ShowProfile_STR' },
{ old: 'V2', new: 'Menu_STR' },
{ old: 'U2', new: 'CouldNotInstallApp_STR' },
{ old: 'H2', new: 'InstallApp_STR' },
{ old: 'Y2', new: 'Livestreams_STR' },
{ old: 'Q2', new: 'LogOut_STR' },
{ old: 'rw', new: 'HideUI_STR' },
{ old: 'aw', new: 'ChangePicture_STR' },
{ old: 'lw', new: 'ShowLastPaintedPixel_STR' },
{ old: 'Yf', new: 'DeleteAccount_STR' },
{ old: 'pw', new: 'AreYouAbsolutelySure_STR' },
{ old: '_w', new: 'DeleteAccountWarning_STR' },
{ old: 'yw', new: 'Profile_STR' },
{ old: 'ww', new: 'FlagBonusDescription_STR' },
{ old: 'Sw', new: 'NotNeedEquipped_STR' },
{ old: 'Mw', new: 'Equipped_STR' },
{ old: 'Ew', new: 'Equip_STR' },
{ old: 'Uv', new: 'Country_STR' },
{ old: 'Bw', new: 'NoCountryFound_STR' },
{ old: 'Nw', new: 'WelcomeTo_STR' },
{ old: 'v5', new: 'Understood_STR' },
{ old: '$v', new: 'ToggleArtOpacity_STR' },
{ old: 'Gv', new: 'Paint_STR' },
{ old: 'S5', new: 'SelectAColor_STR' },
{ old: 'M5', new: 'SelectPixelToErase_STR' },
{ old: 'E5', new: 'PickColorFromMap_STR' },
{ old: 'D5', new: 'Click_STR' },
{ old: 'F5', new: 'SpaceUpper_STR' },
{ old: 'j5', new: 'OrHold_STR' },
{ old: 'Z5', new: 'ToPaint_STR' },
{ old: 'G5', new: 'PaintMoreThanOnePixel_STR' },
{ old: 'X5', new: 'PaintPixel_STR' },
{ old: 'J5', new: 'ColorPicker_STR' },
{ old: 't3', new: 'MaxChargePerLevel_STR' },
{ old: 'Kf', new: 'Name_STR' },
{ old: 'o3', new: 'DiscordUsername_STR' },
{ old: 'Kg', new: 'MaxChargesLabel_STR' },
{ old: 'c3', new: 'paintChargesEn' },
{ old: 'u3', new: 'paintChargesPt' },
{ old: 'h3', new: 'PaintCharges_STR' },
{ old: 'd3', new: 'paintChargesWithAmountEn' },
{ old: 'p3', new: 'paintChargesWithAmountPt' },
{ old: 'f3', new: 'PaintChargesWithAmount_STR' },
{ old: 'm3', new: 'leaveAllianceEn' },
{ old: '_3', new: 'leaveAlliancePt' },
{ old: 'g3', new: 'LeaveAlliance_STR' },
{ old: 'v3', new: 'headquartersEn' },
{ old: 'y3', new: 'headquartersPt' },
{ old: 'x3', new: 'Headquarters_STR' },
{ old: 'b3', new: 'notSetEn' },
{ old: 'w3', new: 'notSetPt' },
{ old: 'T3', new: 'NotSet_STR' },
{ old: 'C3', new: 'youAreNotInAnAllianceEn' },
{ old: 'S3', new: 'youAreNotInAnAlliancePt' },
{ old: 'P3', new: 'YouAreNotInAnAlliance_STR' },
{ old: 'I3', new: 'getInvitedToAnAllianceEn' },
{ old: 'M3', new: 'getInvitedToAnAlliancePt' },
{ old: 'k3', new: 'GetInvitedToAnAlliance_STR' },
{ old: 'A3', new: 'orEn' },
{ old: 'E3', new: 'orPt' },
{ old: 'z3', new: 'OR_STR' },
{ old: 'L3', new: 'createAnAllianceEn' },
{ old: 'D3', new: 'createAnAlliancePt' },
{ old: 'R3', new: 'CreateAnAlliance_STR' },
{ old: 'B3', new: 'inviteLinkEn' },
{ old: 'F3', new: 'inviteLinkPt' },
{ old: 'O3', new: 'InviteLink_STR' },
{ old: 'N3', new: 'sendTheLinkBelowEn' },
{ old: 'j3', new: 'sendTheLinkBelowPt' },
{ old: 'V3', new: 'SendTheLinkBelow_STR' },
{ old: 'q3', new: 'copiedEn' },
{ old: 'Z3', new: 'copiedPt' },
{ old: 'Fm', new: 'Copied_STR' },
{ old: 'U3', new: 'noDescriptionEn' },
{ old: '$3', new: 'noDescriptionPt' },
{ old: 'Hv', new: 'NoDescription_STR' },
{ old: 'G3', new: 'inviteEn' },
{ old: 'H3', new: 'invitePt' },
{ old: 'W3', new: 'Invite_STR' },
{ old: 'X3', new: 'noPixelsPaintedEn' },
{ old: 'Y3', new: 'noPixelsPaintedPt' },
{ old: 'Om', new: 'NoPixelsPainted_STR' },
{ old: 'K3', new: 'todayEn' },
{ old: 'J3', new: 'todayPt' },
{ old: 'vp', new: 'Today_STR' },
{ old: 'Q3', new: 'weekEn' },
{ old: 'eT', new: 'weekPt' },
{ old: 'tT', new: 'Week_STR' },
{ old: 'rT', new: 'monthEn' },
{ old: 'nT', new: 'monthPt' },
{ old: 'iT', new: 'Month_STR' },
{ old: 'aT', new: 'allTimeEn' },
{ old: 'oT', new: 'allTimePt' },
{ old: 'sT', new: 'AllTime_STR' },
{ old: 'lT', new: 'thisWeekEn' },
{ old: 'cT', new: 'thisWeekPt' },
{ old: 'Nm', new: 'ThisWeek_STR' },
{ old: 'uT', new: 'thisMonthEn' },
{ old: 'hT', new: 'thisMonthPt' },
{ old: 'jm', new: 'ThisMonth_STR' },
{ old: 'dT', new: 'createAllianceEn' },
{ old: 'pT', new: 'createAlliancePt' },
{ old: 'fT', new: 'CreateAlliance_STR' },
{ old: 'mT', new: 'allianceNameEn' },
{ old: '_T', new: 'allianceNamePt' },
{ old: 'gT', new: 'AllianceName_STR' },
{ old: 'vT', new: 'createEn' },
{ old: 'yT', new: 'createPt' },
{ old: 'xT', new: 'Create_STR' },
{ old: 'bT', new: 'giveAdminEn' },
{ old: 'wT', new: 'giveAdminPt' },
{ old: 'TT', new: 'GiveAdmin_STR' },
{ old: 'CT', new: 'banFromAllianceEn' },
{ old: 'ST', new: 'banFromAlliancePt' },
{ old: 'Wv', new: 'BanFromAlliance_STR' },
{ old: 'PT', new: 'noActionEn' },
{ old: 'IT', new: 'noActionPt' },
{ old: 'MT', new: 'NoAction_STR' },
{ old: 'kT', new: 'unbanEn' },
{ old: 'AT', new: 'unbanPt' },
{ old: 'ET', new: 'Unban_STR' },
{ old: 'zT', new: 'noBannedUsersEn' },
{ old: 'LT', new: 'noBannedUsersPt' },
{ old: 'DT', new: 'NoBannedUsers_STR' },
{ old: 'RT', new: 'updateEn' },
{ old: 'BT', new: 'updatePt' },
{ old: 'FT', new: 'Update_STR' },
{ old: 'OT', new: 'errorGivingAdminEn' },
{ old: 'NT', new: 'errorGivingAdminPt' },
{ old: 'jT', new: 'ErrorGivingAdmin_STR' },
{ old: 'VT', new: 'usersEn' },
{ old: 'qT', new: 'usersPt' },
{ old: 'ZT', new: 'Users_STR' },
{ old: 'UT', new: 'bannedEn' },
{ old: '$T', new: 'bannedPt' },
{ old: 'Xv', new: 'Banned_STR' },
{ old: 'GT', new: 'regionsEn' },
{ old: 'HT', new: 'regionsPt' },
{ old: 'WT', new: 'Regions_STR' },
{ old: 'XT', new: 'countriesEn' },
{ old: 'YT', new: 'countriesPt' },
{ old: 'KT', new: 'Countries_STR' },
{ old: 'JT', new: 'playersEn' },
{ old: 'QT', new: 'playersPt' },
{ old: 'Yv', new: 'Players_STR' },
{ old: 'eC', new: 'alliancesEn' },
{ old: 'tC', new: 'alliancesPt' },
{ old: 'Kv', new: 'Alliances_STR' },
{ old: 'rC', new: 'regionEn' },
{ old: 'nC', new: 'regionPt' },
{ old: 'iC', new: 'Region_STR' },
{ old: 'aC', new: 'pixelsEn' },
{ old: 'oC', new: 'pixelsPt' },
{ old: 'vc', new: 'Pixels_STR' },
{ old: 'sC', new: 'paintedEn' },
{ old: 'lC', new: 'paintedPt' },
{ old: 'yc', new: 'Painted_STR' },
{ old: 'cC', new: 'pixelsPaintedInsideRegionEn' },
{ old: 'uC', new: 'pixelsPaintedInsideRegionPt' },
{ old: 'hC', new: 'PixelsPaintedInsideRegion_STR' },
{ old: 'dC', new: 'notPaintedEn' },
{ old: 'pC', new: 'notPaintedPt' },
{ old: 'fC', new: 'NotPainted_STR' },
{ old: 'mC', new: 'paintedByEn' },
{ old: '_C', new: 'paintedByPt' },
{ old: 'gC', new: 'PaintedBy_STR' },
{ old: 'vC', new: 'limitReachedEn' },
{ old: 'yC', new: 'limitReachedPt' },
{ old: 'xC', new: 'LimitReached_STR' },
{ old: 'bC', new: 'favoriteEn' },
{ old: 'wC', new: 'favoritePt' },
{ old: 'TC', new: 'Favorite_STR' },
{ old: 'CC', new: 'shareEn' },
{ old: 'SC', new: 'sharePt' },
{ old: 'PC', new: 'Share_STR' },
{ old: 'IC', new: 'sharePlaceEn' },
{ old: 'MC', new: 'sharePlacePt' },
{ old: 'kC', new: 'SharePlace_STR' },
{ old: 'AC', new: 'muteEn' },
{ old: 'EC', new: 'mutePt' },
{ old: 'zC', new: 'Mute_STR' },
{ old: 'LC', new: 'unmuteEn' },
{ old: 'DC', new: 'unmutePt' },
{ old: 'RC', new: 'Unmute_STR' },
{ old: 'BC', new: 'selectHeadquartersLocationEn' },
{ old: 'FC', new: 'selectHeadquartersLocationPt' },
{ old: 'OC', new: 'SelectHeadquartersLocation_STR' },
{ old: 'NC', new: 'pixelsPaintedInsideCountryEn' },
{ old: 'jC', new: 'pixelsPaintedInsideCountryPt' },
{ old: 'VC', new: 'PixelsPaintedInsideCountry_STR' },
{ old: 'qC', new: 'usernameCopiedToClipboardEn' },
{ old: 'ZC', new: 'usernameCopiedToClipboardPt' },
{ old: 'UC', new: 'UsernameCopiedToClipboard_STR' },
{ old: '$C', new: 'noMoreChargesEn' },
{ old: 'GC', new: 'noMoreChargesPt' },
{ old: 'HC', new: 'NoMoreCharges_STR' },
{ old: 'WC', new: 'multiAccountWarningEn' },
{ old: 'XC', new: 'multiAccountWarningPt' },
{ old: 'YC', new: 'MultiAccountWarning_STR' },
{ old: 'KC', new: 'smsSentToEn' },
{ old: 'JC', new: 'smsSentToPt' },
{ old: 'QC', new: 'SmsSentTo_STR' },
{ old: 'eS', new: 'phoneSuccessfullyVerifiedEn' },
{ old: 'tS', new: 'phoneSuccessfullyVerifiedPt' },
{ old: 'rS', new: 'PhoneSuccessfullyVerified_STR' },
{ old: 'nS', new: 'notAValidPhoneNumberEn' },
{ old: 'iS', new: 'notAValidPhoneNumberPt' },
{ old: 'aS', new: 'NotAValidPhoneNumber_STR' },
{ old: 'oS', new: 'locationUnfavoritedEn' },
{ old: 'sS', new: 'locationUnfavoritedPt' },
{ old: 'lS', new: 'LocationUnfavorited_STR' },
{ old: 'cS', new: 'locationFavoritedEn' },
{ old: 'uS', new: 'locationFavoritedPt' },
{ old: 'hS', new: 'LocationFavorited_STR' },
{ old: 'dS', new: 'givingAdminToUserEn' },
{ old: 'pS', new: 'givingAdminToUserPt' },
{ old: 'fS', new: 'GivingAdminToUser_STR' },
{ old: 'mS', new: 'profileUpdatedEn' },
{ old: '_S', new: 'profileUpdatedPt' },
{ old: 'gS', new: 'ProfileUpdated_STR' },
{ old: 'vS', new: 'discordLinkedEn' },
{ old: 'yS', new: 'discordLinkedPt' },
{ old: 'xS', new: 'DiscordLinked_STR' },
{ old: 'bS', new: 'discordUnlinkedEn' },
{ old: 'wS', new: 'discordUnlinkedPt' },
{ old: 'TS', new: 'DiscordUnlinked_STR' },
{ old: 'CS', new: 'linkYourDiscordEn' },
{ old: 'SS', new: 'linkYourDiscordPt' },
{ old: 'PS', new: 'LinkYourDiscord_STR' },
{ old: 'IS', new: 'unlinkDiscordEn' },
{ old: 'MS', new: 'unlinkDiscordPt' },
{ old: 'kS', new: 'UnlinkDiscord_STR' },
{ old: 'AS', new: 'accountSuccessfullyDeletedEn' },
{ old: 'ES', new: 'accountSuccessfullyDeletedPt' },
{ old: 'zS', new: 'AccountSuccessfullyDeleted_STR' },
{ old: 'LS', new: 'loggedOutEn' },
{ old: 'DS', new: 'loggedOutPt' },
{ old: 'RS', new: 'LoggedOut_STR' },
{ old: 'BS', new: 'couldNotLogoutEn' },
{ old: 'FS', new: 'couldNotLogoutPt' },
{ old: 'OS', new: 'CouldNotLogout_STR' },
{ old: 'NS', new: 'needToZoomInToSelectPixelEn' },
{ old: 'jS', new: 'needToZoomInToSelectPixelPt' },
{ old: 'VS', new: 'NeedToZoomInToSelectPixel_STR' },
{ old: 'qS', new: 'phoneVerificationEn' },
{ old: 'ZS', new: 'phoneVerificationPt' },
{ old: 'US', new: 'PhoneVerification_STR' },
{ old: '$S', new: 'phoneVerificationDescriptionEn' },
{ old: 'GS', new: 'phoneVerificationDescriptionPt' },
{ old: 'HS', new: 'PhoneVerificationDescription_STR' },
{ old: 'WS', new: 'sendCodeEn' },
{ old: 'XS', new: 'sendCodePt' },
{ old: 'YS', new: 'SendCode_STR' },
{ old: 'KS', new: 'inputTheCodeEn' },
{ old: 'JS', new: 'inputTheCodePt' },
{ old: 'QS', new: 'InputTheCode_STR' },
{ old: 'eP', new: 'sentToEn' },
{ old: 'tP', new: 'sentToPt' },
{ old: 'rP', new: 'SentTo_STR' },
{ old: 'nP', new: 'resendCodeEn' },
{ old: 'iP', new: 'resendCodePt' },
{ old: 'aP', new: 'ResendCode_STR' },
{ old: 'oP', new: 'tryAnotherNumberEn' },
{ old: 'sP', new: 'tryAnotherNumberPt' },
{ old: 'lP', new: 'TryAnotherNumber_STR' },
{ old: 'cP', new: 'editProfileEn' },
{ old: 'uP', new: 'editProfilePt' },
{ old: 'hP', new: 'EditProfile_STR' },
{ old: 'dP', new: 'imageEn' },
{ old: 'pP', new: 'imagePt' },
{ old: 'fP', new: 'Image_STR' },
{ old: 'mP', new: 'downloadEn' },
{ old: '_P', new: 'downloadPt' },
{ old: 'gP', new: 'Download_STR' },
{ old: 'vP', new: 'imageCopiedToClipboardEn' },
{ old: 'yP', new: 'imageCopiedToClipboardPt' },
{ old: 'xP', new: 'ImageCopiedToClipboard_STR' },
{ old: 'bP', new: 'myMapIsLaggingEn' },
{ old: 'wP', new: 'myMapIsLaggingPt' },
{ old: 'TP', new: 'MyMapIsLagging_STR' },
{ old: 'CP', new: 'verifyIfEn' },
{ old: 'SP', new: 'verifyIfPt' },
{ old: 'PP', new: 'VerifyIf_STR' },
{ old: 'IP', new: 'useHardwareAccelerationEn' },
{ old: 'MP', new: 'useHardwareAccelerationPt' },
{ old: 'kP', new: 'UseHardwareAcceleration_STR' },
{ old: 'AP', new: 'isEnabledOnEn' },
{ old: 'EP', new: 'isEnabledOnPt' },
{ old: 'zP', new: 'IsEnabledOn_STR' },
{ old: 'LP', new: 'followInstructionsEn' },
{ old: 'DP', new: 'followInstructionsPt' },
{ old: 'RP', new: 'FollowInstructions_STR' },
{ old: 'BP', new: 'moderationEn' },
{ old: 'FP', new: 'moderationPt' },
{ old: 'OP', new: 'Moderation_STR' },
{ old: 'NP', new: 'termsEn' },
{ old: 'jP', new: 'termsPt' },
{ old: 'VP', new: 'Terms_STR' },
{ old: 'qP', new: 'privacyEn' },
{ old: 'ZP', new: 'privacyPt' },
{ old: 'UP', new: 'Privacy_STR' },
{ old: '$P', new: 'refundEn' },
{ old: 'GP', new: 'refundPt' },
{ old: 'Jv', new: 'Refund_STR' },
{ old: 'HP', new: 'clearAreaEn' },
{ old: 'WP', new: 'clearAreaPt' },
{ old: 'XP', new: 'ClearArea_STR' },
{ old: 'YP', new: 'selectFirstCornerEn' },
{ old: 'KP', new: 'selectFirstCornerPt' },
{ old: 'Qv', new: 'SelectFirstCorner_STR' },
{ old: 'JP', new: 'selectOppositeCornerEn' },
{ old: 'QP', new: 'selectOppositeCornerPt' },
{ old: 'e0', new: 'SelectOppositeCorner_STR' },
{ old: 'eI', new: 'adminEn' },
{ old: 'tI', new: 'adminPt' },
{ old: 'rI', new: 'Admin_STR' },
{ old: 'nI', new: 'reasonEn' },
{ old: 'iI', new: 'reasonPt' },
{ old: 'aI', new: 'Reason_STR' },
{ old: 'oI', new: 'noCorrespondingRegionEn' },
{ old: 'sI', new: 'noCorrespondingRegionPt' },
{ old: 'lI', new: 'NoCorrespondingRegion_STR' },
{ old: 'cI', new: 'flagWithoutRegionEn' },
{ old: 'uI', new: 'flagWithoutRegionPt' },
{ old: 'hI', new: 'FlagWithoutRegion_STR' },
{ old: 'dI', new: 'flagNoCorrespondingAreasEn' },
{ old: 'pI', new: 'flagNoCorrespondingAreasPt' },
{ old: 'fI', new: 'FlagNoCorrespondingAreas_STR' },
{ old: 'mI', new: 'darkModeEn' },
{ old: '_I', new: 'darkModePt' },
{ old: 'gI', new: 'DarkMode_STR' },
{ old: 'vI', new: 'lightModeEn' },
{ old: 'yI', new: 'lightModePt' },
{ old: 'xI', new: 'LightMode_STR' },
{ old: 'bI', new: 'logOutFromAllDevicesEn' },
{ old: 'wI', new: 'logOutFromAllDevicesPt' },
{ old: 'TI', new: 'LogOutFromAllDevices_STR' },
{ old: 'CI', new: 'logOutFromAllDevices2En' },
{ old: 'SI', new: 'logOutFromAllDevices2Pt' },
{ old: 'PI', new: 'LogOutFromAllDevices2_STR' },
{ old: 'II', new: 'thisActionWillLogOutEn' },
{ old: 'MI', new: 'thisActionWillLogOutPt' },
{ old: 'kI', new: 'ThisActionWillLogOut_STR' },
{ old: 'AI', new: 'sessionsSuccessfullyRevokedEn' },
{ old: 'EI', new: 'sessionsSuccessfullyRevokedPt' },
{ old: 'zI', new: 'SessionsSuccessfullyRevoked_STR' },
{ old: 'LI', new: 'errorRevokingSessionsEn' },
{ old: 'DI', new: 'errorRevokingSessionsPt' },
{ old: 'RI', new: 'ErrorRevokingSessions_STR' },
{ old: 'BI', new: 'moreEn' },
{ old: 'FI', new: 'morePt' },
{ old: 'OI', new: 'More_STR' },
{ old: 'NI', new: 'thisActionIsIrreversibleEn' },
{ old: 'jI', new: 'thisActionIsIrreversiblePt' },
{ old: 'VI', new: 'ThisActionIsIrreversible_STR' },
{ old: 'qI', new: 'pleaseConfirmByEnteringUsernameEn' },
{ old: 'ZI', new: 'pleaseConfirmByEnteringUsernamePt' },
{ old: 'UI', new: 'PleaseConfirmByEnteringUsername_STR' },
{ old: '$I', new: 'typeYourUsernameEn' },
{ old: 'GI', new: 'typeYourUsernamePt' },
{ old: 'HI', new: 'TypeYourUsername_STR' },
{ old: 'WI', new: 'thisActionMayTakeTimeEn' },
{ old: 'XI', new: 'thisActionMayTakeTimePt' },
{ old: 'YI', new: 'ThisActionMayTakeTime_STR' },
{ old: 'KI', new: 'banAppealEn' },
{ old: 'JI', new: 'banAppealPt' },
{ old: 'QI', new: 'BanAppeal_STR' },
{ old: 'e4', new: 'suggestionsEn' },
{ old: 't4', new: 'suggestionsPt' },
{ old: 'r4', new: 'Suggestions_STR' },
{ old: 'n4', new: 'bugReportEn' },
{ old: 'i4', new: 'bugReportPt' },
{ old: 'a4', new: 'BugReport_STR' }
];
// Apply all replacements using word boundary regex
replacements.forEach(({ old, new: newName }) => {
// Use word boundary to match whole identifiers only
const regex = new RegExp(`\\b${old.replace(/\$/g, '\\$')}\\b`, 'g');
content = content.replace(regex, newName);
});
// Write the file back
fs.writeFileSync(filePath, content, 'utf8');
console.log(`Successfully renamed ${replacements.length} variables`);