From 8565bf280a33eccf0c96eff4504ddc1ce84e0c2e Mon Sep 17 00:00:00 2001 From: Furo Date: Tue, 22 Jul 2025 22:59:56 +0200 Subject: [PATCH] Character Editor Translatable --- assets/languages/en/Editors.xml | 148 +++++++++--------- .../editors/character/CharacterAnimButton.hx | 13 +- .../editors/character/CharacterAnimsWindow.hx | 5 +- .../character/CharacterCreationScreen.hx | 15 +- .../editors/character/CharacterEditor.hx | 35 +++-- .../editors/character/CharacterInfoScreen.hx | 8 +- .../character/CharacterPropertiesWindow.hx | 20 +-- .../character/CharacterSpriteScreen.hx | 11 +- .../editors/stage/StageCreationScreen.hx | 2 +- source/funkin/editors/ui/UIImageExplorer.hx | 31 ++-- 10 files changed, 155 insertions(+), 133 deletions(-) diff --git a/assets/languages/en/Editors.xml b/assets/languages/en/Editors.xml index 4bd3292b..419d3fa9 100644 --- a/assets/languages/en/Editors.xml +++ b/assets/languages/en/Editors.xml @@ -11,6 +11,24 @@ Close + + Symbol + Animation + Atlas + Spritemap + + Directory ({0}/) + {0} {1} Found + {0} {1} Found + #NO {0}s Found# + {0} Spritemap Found + {0} Spritemaps Found + + The following files alreadly exist: \n\n{0}\n\nIMPORTANT: OVERRIDING CAN NOT BE UNDONE!!!!!!!! + Override Files + Use Existing + + Chart Editor Character Editor @@ -314,52 +332,16 @@ Press ACCEPT to create a new character. Select a character to edit Select a character to edit in {0} - - - New Character: Feature Not Implemented! - This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Crew - - - - - Creating Animation - Animation {0} properties - - Create New Animation - Edit Animation Properties - - Name - Animation - FPS - Looped - Looping - Indices - Offset (X,Y) Editing Character - - Sprite Data - - Sprite + Edit Character Info Icon - Game Over Character - Antialiasing - Antialiased - Flip X - Flipped Icon Color - - Character Data - - Position (X,Y) - Camera Position (X,Y) - Scale - Sing Duration (Steps) + Sing Duration + Use Sing Duration? Custom Values (Advanced) - Is Player - Is GF @@ -374,22 +356,12 @@ Edit + Copy Offset + Paste Offset Undo Redo - - - Character - - New Animation - Edit Animation - Delete Animation - Edit Info - - - Playback - - Play Animation - Stop Animation + Edit information + Edit sprite Offsets @@ -402,34 +374,68 @@ Move Extra Up Move Extra Down Move Extra Right + Drag Offsets With Mouse? Clear Offsets + Stage + + Use "{0}" + Use No Stage + + View Zoom in Zoom out Reset Zoom + Character Hitbox? + Character Camera? + XY Axis? + + + Animation + + Play Animation + Stop Animation + Change Animation ↑ + Change Animation ↓ + Play Animation On Offset? + + + + Position (X, Y) + Scale + Edit Info + Edit Sprite + Camera Position (X, Y) + Flipped? + Antialiased? + Test Character As... + Char Designed As... + + + + New Anim + Name + Animation + Position (X, Y) + FPS + Indices (Frames) + + + + Edit character sprite + Character Image File $* Required$ + Character Editor + - - Character Animations - - - Character Properties - - New Character - Edit Character Info - - - {0} Animations - Flipped: {0} - Sprite: {0} - Anim: {0} - Offset: ({0}, {1}) - - Invalid Character + + Creating New Character + Character Name $* Required$ + Character Image File $* Required$ @@ -441,7 +447,7 @@ New Typeface: Feature Not Implemented! - This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Devs + This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Crew diff --git a/source/funkin/editors/character/CharacterAnimButton.hx b/source/funkin/editors/character/CharacterAnimButton.hx index 61182562..66d220ae 100644 --- a/source/funkin/editors/character/CharacterAnimButton.hx +++ b/source/funkin/editors/character/CharacterAnimButton.hx @@ -48,6 +48,9 @@ class CharacterAnimButton extends UIButton { public var foldableButtons:Array = []; public var closed:Bool = true; + inline function translate(id:String, ?args:Array) + return TU.translate("characterEditor.characterAnim." + id, args); + public function new(x:Float, y:Float, animData:AnimData, parent:CharacterAnimsWindow) { this.anim = animData.name; this.data = animData; @@ -76,13 +79,13 @@ class CharacterAnimButton extends UIButton { nameTextBox.onChange = (newName:String) -> {this.changeName(newName);}; members.push(nameTextBox); foldableButtons.push(nameTextBox); - addLabelOn(nameTextBox, "Name", 12); + addLabelOn(nameTextBox, translate("name"), 12); animTextBox = new UIAutoCompleteTextBox(nameTextBox.x + 100, nameTextBox.y, animData.anim, 156, 22, false, true); animTextBox.onChange = (newAnim:String) -> {this.changeAnim(newAnim);}; members.push(animTextBox); foldableButtons.push(animTextBox); - addLabelOn(animTextBox, "Animation", 12); + addLabelOn(animTextBox, translate("anim"), 12); positionXStepper = new UINumericStepper(animTextBox.x, animTextBox.y+32+18, animData.x, 0.001, 2, null, null, 64, 22, true); positionXStepper.onChange = (text:String) -> { @@ -91,7 +94,7 @@ class CharacterAnimButton extends UIButton { }; members.push(positionXStepper); foldableButtons.push(positionXStepper); - addLabelOn(positionXStepper, "Position (X,Y)", 12); + addLabelOn(positionXStepper, translate("position"), 12); members.push(XYComma = new UIText(positionXStepper.x+104-32+0, positionXStepper.y + 9, 0, ",", 18)); foldableButtons.push(XYComma); @@ -111,7 +114,7 @@ class CharacterAnimButton extends UIButton { }; members.push(fpsStepper); foldableButtons.push(fpsStepper); - addLabelOn(fpsStepper, "FPS", 12); + addLabelOn(fpsStepper, translate("fps"), 12); loopedCheckbox = new UICheckbox(fpsStepper.x + 82 - 32 + 26, fpsStepper.y, "Looping?", animData.loop, 0, true); loopedCheckbox.onChecked = (newLooping:Bool) -> {this.changeLooping(newLooping);}; @@ -126,7 +129,7 @@ class CharacterAnimButton extends UIButton { } members.push(indicesTextBox); foldableButtons.push(indicesTextBox); - addLabelOn(indicesTextBox, "Indices (frames)", 12); + addLabelOn(indicesTextBox, translate("indices"), 12); animIcon = new FlxSprite(x-(10+16), y+8).loadGraphic(Paths.image("editors/character/anim-icons"), true, 16, 12); animIcon.animation.add("play", [0]); diff --git a/source/funkin/editors/character/CharacterAnimsWindow.hx b/source/funkin/editors/character/CharacterAnimsWindow.hx index a58f790f..fe4387d2 100644 --- a/source/funkin/editors/character/CharacterAnimsWindow.hx +++ b/source/funkin/editors/character/CharacterAnimsWindow.hx @@ -112,13 +112,14 @@ class CharacterAnimsWindow extends UIButtonList { } public function generateAnimation() { - var animName:String = "New Anim"; + var newAnim = TU.translate("characterEditor.characterAnim.defaultAnimName"); + var animName:String = newAnim; var animNames:Array = character.getNameList(); var newAnimCount:Int = 0; while (animNames.indexOf(animName) != -1) { newAnimCount++; - animName = 'New Anim - $newAnimCount'; + animName = '$newAnim - $newAnimCount'; } if (__autoCompleteAnims.length <= 0) diff --git a/source/funkin/editors/character/CharacterCreationScreen.hx b/source/funkin/editors/character/CharacterCreationScreen.hx index 14072d31..3e10082a 100644 --- a/source/funkin/editors/character/CharacterCreationScreen.hx +++ b/source/funkin/editors/character/CharacterCreationScreen.hx @@ -15,13 +15,16 @@ class CharacterCreationScreen extends UISubstateWindow { public var saveButton:UIButton; public var closeButton:UIButton; + inline function translate(id:String, ?args:Array) + return TU.translate("characterCreationScreen." + id, args); + public function new(?onSave:(String, ImageSaveData, Xml)->Void) { super(); if (onSave != null) this.onSave = onSave; } public override function create() { - winTitle = "Creating New Character"; + winTitle = translate("win-title"); winWidth = 360; winHeight = 520; @@ -37,14 +40,14 @@ class CharacterCreationScreen extends UISubstateWindow { characterNameTextBox = new UITextBox(windowSpr.x + 20, windowSpr.y + 30 + 16 + 20, "character", 320); characterNameTextBox.onChange = (_) -> {checkRequired();}; add(characterNameTextBox); - addLabelOn(characterNameTextBox, "Character File Name").applyMarkup( - "Character File Name $* Required$", + addLabelOn(characterNameTextBox, "").applyMarkup( + translate("charName"), [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); imageExplorer = new UIImageExplorer(characterNameTextBox.x, characterNameTextBox.y + 30 + 16 + 20, null, 320, 58, (_, _) -> {onLoadImage();}, "images/characters"); add(imageExplorer); - addLabelOn(imageExplorer, "Character Image File").applyMarkup( - "Character Image File $* Required$", + addLabelOn(imageExplorer, "").applyMarkup( + translate("charImgName"), [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); imageExplorer.maxSize.y -= 100; @@ -54,7 +57,7 @@ class CharacterCreationScreen extends UISubstateWindow { }, 125); add(saveButton); - closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, "Cancel", function() { + closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, TU.translate("editor.cancel"), function() { close(); }, 125); add(closeButton); diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index 8a096987..b1e8e5b2 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -107,12 +107,12 @@ class CharacterEditor extends UIState { label: translate("topBar.edit"), childs: [ { - label: "Copy Offset", + label: translate("edit.copyOffset"), keybind: [CONTROL, C], onSelect: _edit_copy_offset }, { - label: "Paste Offset", + label: translate("edit.pasteOffset"), keybind: [CONTROL, V], onSelect: _edit_paste_offset }, @@ -129,13 +129,13 @@ class CharacterEditor extends UIState { }, null, { - label: "Edit information", + label: translate("edit.editInfo"), color: 0xFF959829, icon: 4, onCreate: function (button:UIContextMenuOptionSpr) {button.label.offset.x = button.icon.offset.x = -2;}, onSelect: _edit_info }, { - label: "Edit sprite", + label: translate("edit.editSprite"), color: 0xFF959829, icon: 4, onCreate: function (button:UIContextMenuOptionSpr) {button.label.offset.x = button.icon.offset.x = -2;}, onSelect: _edit_sprite @@ -188,7 +188,7 @@ class CharacterEditor extends UIState { }, null, { - label: "Drag Offsets With Mouse?", + label: translate("offset.dragOffsetsMouse"), onSelect: _offsets_drag_offsets_mouse, icon: Options.characterDragging ? 1 : 0 }, @@ -200,7 +200,7 @@ class CharacterEditor extends UIState { ] }, { - label: "Stage", + label: translate("topBar.stage"), childs: buildStagesUI() }, { @@ -223,48 +223,48 @@ class CharacterEditor extends UIState { }, null, { - label: "Character Hitbox?", + label: translate("view.charHitbox"), onSelect: _view_character_show_hitbox, icon: Options.characterHitbox ? 1 : 0 }, { - label: "Character Camera?", + label: translate("view.charCam"), onSelect: _view_character_show_camera, icon: Options.characterCamera ? 1 : 0 }, { - label: "XY Axis?", + label: translate("view.axis"), onSelect: _view_character_show_axis, icon: Options.characterAxis ? 1 : 0 } ] }, { - label: "Animation >", + label: translate("topBar.animation") + " >", childs: [ { - label: "Play Animation", + label: translate("animation.playAnim"), keybind: [SPACE], onSelect: _animation_play, }, { - label: "Stop Animation", + label: translate("animation.stopAnim"), onSelect: _animation_stop }, null, { - label: "Change Animation ↑", + label: translate("animation.changeAnimUp"), keybind: [W], onSelect: _animation_up }, { - label: "Change Animation ↓", + label: translate("animation.changeAnimDown"), keybind: [S], onSelect: _animation_down }, null, { - label: "Play Animation On Offset?", + label: translate("animation.playAnimOnOffset"), onSelect: _animation_toggle_anim_playing_offsets, icon: Options.playAnimOnOffset ? 1 : 0 }, @@ -685,16 +685,17 @@ class CharacterEditor extends UIState { var stageFileList = Stage.getList(true); if (stageFileList.length == 0) stageFileList = Stage.getList(false); + var stageText = TU.getRaw("characterEditor.stage.useStage"); for (stage in stageFileList) newChilds.push({ - label: 'Use "$stage"?', + label: stageText.format([stage]), icon: currentStage == stage ? 1 : 0, onSelect: (_) -> {changeStage(stage);} }); newChilds.push(null); newChilds.push({ - label: "Use No Stage?", + label: translate("stage.useNone"), icon: currentStage == null ? 1 : 0, onSelect: (_) -> {changeStage(null);} }); diff --git a/source/funkin/editors/character/CharacterInfoScreen.hx b/source/funkin/editors/character/CharacterInfoScreen.hx index 406c74d9..f085d2c3 100644 --- a/source/funkin/editors/character/CharacterInfoScreen.hx +++ b/source/funkin/editors/character/CharacterInfoScreen.hx @@ -53,11 +53,11 @@ class CharacterInfoScreen extends UISubstateWindow { add(new UIText(ui.x, ui.y - 24, 0, text)); var title:UIText; - add(title = new UIText(windowSpr.x + 20, windowSpr.y + 30 + 16, 0, "Edit Character Info", 28)); + add(title = new UIText(windowSpr.x + 20, windowSpr.y + 30 + 16, 0, translate("title"), 28)); iconColorPicker = new UIIconColorPicker(title.x, title.y + title.height + 38, character.getIcon(), character.antialiasing, null); add(iconColorPicker); - addLabelOn(iconColorPicker, "Icon"); + addLabelOn(iconColorPicker, translate("icon")); iconColorWheel = new UIColorwheel(iconColorPicker.x+12+125+12+22, iconColorPicker.y, character.iconColor); add(iconColorWheel); @@ -69,9 +69,9 @@ class CharacterInfoScreen extends UISubstateWindow { durationStepper = new UINumericStepper(iconColorWheel.x, iconColorWheel.y + 125 + 36, character.holdTime == -1 ? 4 : character.holdTime, 0.001, 2, 0, 9999999, 74); add(durationStepper); - addLabelOn(durationStepper, "Sing Duration"); + addLabelOn(durationStepper, translate("singDuration")); - useDurationCheckbox = new UICheckbox(durationStepper.x + durationStepper.bWidth + 20, durationStepper.y+6, "Use Sing Duration?", character.holdTime != -1); + useDurationCheckbox = new UICheckbox(durationStepper.x + durationStepper.bWidth + 20, durationStepper.y+6, translate("useSingDuration"), character.holdTime != -1); useDurationCheckbox.onChecked = (checked:Bool) -> {durationStepper.selectable = checked;}; add(useDurationCheckbox); diff --git a/source/funkin/editors/character/CharacterPropertiesWindow.hx b/source/funkin/editors/character/CharacterPropertiesWindow.hx index e5bd08ea..fd016b0c 100644 --- a/source/funkin/editors/character/CharacterPropertiesWindow.hx +++ b/source/funkin/editors/character/CharacterPropertiesWindow.hx @@ -28,7 +28,7 @@ class CharacterPropertiesWindow extends UISliceSprite { public var labels:Map = []; inline function translate(id:String, ?args:Array) - return TU.translate("characterEditor.characterPropertiesWindow." + id, args); + return TU.translate("characterEditor.characterProperties." + id, args); public function new(x:Float, y:Float, character:Character) @:privateAccess { super(x, y, 424+16, 204+20, "editors/ui/inputbox"); @@ -44,7 +44,7 @@ class CharacterPropertiesWindow extends UISliceSprite { this.changePosition(positionXStepper.value, null); }; members.push(positionXStepper); - addLabelOn(positionXStepper, "Position (X,Y)"); + addLabelOn(positionXStepper, translate("position")); members.push(positionXYComma = new UIText(positionXStepper.x+104-32+0, positionXStepper.y + 9, 0, ",", 22)); @@ -61,17 +61,17 @@ class CharacterPropertiesWindow extends UISliceSprite { this.changeScale(scaleStepper.value); }; members.push(scaleStepper); - addLabelOn(scaleStepper, "Scale"); + addLabelOn(scaleStepper, translate("scale")); - editCharacterButton = new UIButton(scaleStepper.x + 90 -32 + 26, scaleStepper.y-20, "Edit Info", editCharacterInfoUI, 120, 24); + editCharacterButton = new UIButton(scaleStepper.x + 90 -32 + 26, scaleStepper.y-20, translate("editInfo"), editCharacterInfoUI, 120, 24); editCharacterButton.field.size -= 2; members.push(editCharacterButton); - editSpriteButton = new UIButton(editCharacterButton.x, editCharacterButton.y+24+6, "Edit Sprite", editCharacterSpriteUI, 120, 24); + editSpriteButton = new UIButton(editCharacterButton.x, editCharacterButton.y+24+6, translate("editSprite"), editCharacterSpriteUI, 120, 24); editSpriteButton.field.size -= 2; members.push(editSpriteButton); - flipXCheckbox = new UICheckbox(scaleStepper.x+22, scaleStepper.y+32+14, "Flipped?", character.isPlayer ? !character.__baseFlipped : character.__baseFlipped); + flipXCheckbox = new UICheckbox(scaleStepper.x+22, scaleStepper.y+32+14, translate("charFlipped"), character.isPlayer ? !character.__baseFlipped : character.__baseFlipped); flipXCheckbox.onChecked = (checked:Bool) -> {this.changeFlipX(checked);}; members.push(flipXCheckbox); @@ -81,7 +81,7 @@ class CharacterPropertiesWindow extends UISliceSprite { this.changeCamPosition(cameraXStepper.value, null); }; members.push(cameraXStepper); - addLabelOn(cameraXStepper, "Camera Position (X,Y)"); + addLabelOn(cameraXStepper, translate("camPosition")); members.push(cameraXYComma = new UIText(cameraXStepper.x + 104-32+0, cameraXStepper.y+9, 0, ",", 22)); @@ -92,7 +92,7 @@ class CharacterPropertiesWindow extends UISliceSprite { }; members.push(cameraYStepper); - antialiasingCheckbox = new UICheckbox(scaleStepper.x+22, flipXCheckbox.y+32, "Antialiased?", character.antialiasing); + antialiasingCheckbox = new UICheckbox(scaleStepper.x+22, flipXCheckbox.y+32, translate("antialiased"), character.antialiasing); antialiasingCheckbox.onChecked = (checked:Bool) -> {this.changeAntialiasing(checked);}; members.push(antialiasingCheckbox); @@ -101,7 +101,7 @@ class CharacterPropertiesWindow extends UISliceSprite { CharacterEditor.instance.changeStagePosition(testAsDropDown.options[index]); }; members.push(testAsDropDown); - addLabelOn(testAsDropDown, "Test Character As..."); + addLabelOn(testAsDropDown, translate("testCharAs")); testAsDropDown.bWidth = 193; //REFUSES TO FUCKING SET TO 170 PIECE OF SHIT!! designedAsDropDown = new UIDropDown(testAsDropDown.x+193+22, testAsDropDown.y, 193, 32, ["BOYFRIEND", "DAD"], character.playerOffsets ? 0 : 1); @@ -109,7 +109,7 @@ class CharacterPropertiesWindow extends UISliceSprite { CharacterEditor.instance.changeCharacterDesginedAs(designedAsDropDown.options[index] == "BOYFRIEND"); }; members.push(designedAsDropDown); - addLabelOn(designedAsDropDown, "Char Desgined As..."); + addLabelOn(designedAsDropDown, translate("charDesign")); designedAsDropDown.bWidth = 193; alpha = 0.7; diff --git a/source/funkin/editors/character/CharacterSpriteScreen.hx b/source/funkin/editors/character/CharacterSpriteScreen.hx index 8e8ea925..ceb2ed6d 100644 --- a/source/funkin/editors/character/CharacterSpriteScreen.hx +++ b/source/funkin/editors/character/CharacterSpriteScreen.hx @@ -16,6 +16,9 @@ class CharacterSpriteScreen extends UISubstateWindow { public var saveButton:UIButton; public var closeButton:UIButton; + inline function translate(id:String, ?args:Array) + return TU.translate("characterEditor.characterSpriteScreen." + id, args); + public function new(imagePath:String, ?onSave:(String, Bool)->Void) { super(); this.imagePath = imagePath; @@ -23,7 +26,7 @@ class CharacterSpriteScreen extends UISubstateWindow { } public override function create() { - winTitle = 'Edit character sprite'; + winTitle = translate("win-title"); winWidth = 360; winHeight = 183; function addLabelOn(ui:UISprite, text:String):UIText { @@ -36,8 +39,8 @@ class CharacterSpriteScreen extends UISubstateWindow { imageExplorer = new UIImageExplorer(20, windowSpr.y + 30 + 16 + 20, imagePath, 320, 58, (_, _) -> {onLoadImage();}, "images/characters"); add(imageExplorer); - addLabelOn(imageExplorer, "Character Image File").applyMarkup( - "Character Image File $* Required$", + addLabelOn(imageExplorer, "").applyMarkup( + translate('charImageFile'), [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); ogImageSaveData = imageExplorer.getSaveData(); @@ -53,7 +56,7 @@ class CharacterSpriteScreen extends UISubstateWindow { saveButton.y -= saveButton.bHeight; saveButton.selectable = false; - closeButton = new UIButton(saveButton.x - 20, saveButton.y, "Cancel", function() { + closeButton = new UIButton(saveButton.x - 20, saveButton.y, TU.translate("editor.cancel"), function() { close(); }, 125); closeButton.color = 0xFFFF0000; diff --git a/source/funkin/editors/stage/StageCreationScreen.hx b/source/funkin/editors/stage/StageCreationScreen.hx index f669ba79..90ac7d85 100644 --- a/source/funkin/editors/stage/StageCreationScreen.hx +++ b/source/funkin/editors/stage/StageCreationScreen.hx @@ -48,7 +48,7 @@ class StageCreationScreen extends UISubstateWindow { close(); }, 125)); - add(closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, "Cancel", close, 125)); + add(closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, TU.translate("editor.cancel"), close, 125)); closeButton.color = 0xFFFF0000; } diff --git a/source/funkin/editors/ui/UIImageExplorer.hx b/source/funkin/editors/ui/UIImageExplorer.hx index ecf98e19..12268e4d 100644 --- a/source/funkin/editors/ui/UIImageExplorer.hx +++ b/source/funkin/editors/ui/UIImageExplorer.hx @@ -35,6 +35,9 @@ class UIImageExplorer extends UIFileExplorer { public var directoryTextBoxLabel:UIText; public var directoryTextBox:UITextBox; + inline function translate(id:String, ?args:Array) + return TU.translate("uiImageExplorer." + id, args); + public function new(x:Float, y:Float, image:String, ?w:Int, ?h:Int, ?onFile:(String, Bytes)->Void, ?directory:String = "images") { super(x, y, w, h, "png, jpg", function (filePath, file) { if (filePath != null && file != null) uploadImage(filePath, file); @@ -51,7 +54,7 @@ class UIImageExplorer extends UIFileExplorer { members.push(directoryIcon); directoryBG = new UISliceSprite(0, 0, 210+16, 8+12+4+22+8, 'editors/ui/inputbox'); - directoryBG.alpha = 0.9; directoryBG.members.push(directoryTextBoxLabel = new UIText(8, 6, 0, 'Directory ($directory/)', 12)); + directoryBG.alpha = 0.9; directoryBG.members.push(directoryTextBoxLabel = new UIText(8, 6, 0, TU.getRaw('uiImageExplorer.directory').format([directory]), 12)); directoryTextBox = new UITextBox(8, 8+12+4, "", 210, 22, false, true); directoryBG.members.push(directoryTextBox); @@ -245,17 +248,18 @@ class UIImageExplorer extends UIFileExplorer { message.add('${imagePath.file}.${imagePath.ext}'); message.add(' (${CoolUtil.getSizeString(size)}'); + var typeOfFrame = isAtlas ? translate("symbol") : translate("animation"); + var shouldUsePlural = animationList.length != 1; if (animationList.length > 0) { - if(animationList.length == 1) message.add(', ${animationList.length} ${isAtlas ? "Symbol" : "Animation"} Found'); - else message.add(', ${animationList.length} ${isAtlas ? "Symbol" : "Animation"}s Found'); - } else message.add(', #NO ${isAtlas ? "Symbol" : "Animation"}s Found#'); + message.add(', ${TU.getRaw("uiImageExplorer." + (shouldUsePlural ? "foundplural" : "found")).format([animationList.length, typeOfFrame])}'); + } else message.add(', ${TU.getRaw("uiImageExplorer.notFound").format([typeOfFrame])}'); if (isAtlas) { - if(spritemaps.length == 1) message.add(', ${spritemaps.length} Spritemap Found'); - else message.add(', ${spritemaps.length} Spritemaps Found'); + shouldUsePlural = spritemaps.length != 1; + message.add(', ${TU.getRaw("uiImageExplorer.foundAtlas" + (shouldUsePlural ? "plural" : "")).format([spritemaps.length])}'); } message.add(')'); - message.add(isAtlas ? " - Atlas" : " - Spritemap"); + message.add(isAtlas ? ' - ${translate("atlas")}' : ' - ${translate("spritemap")}'); fileText = new UIText(x+20, y+16, bWidth-20-deleteButton.bWidth-16, ""); fileText.applyMarkup(message.toString(), [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "#")]); @@ -337,10 +341,9 @@ class UIImageExplorer extends UIFileExplorer { } if (alreadlyExistingFiles.length > 0 && checkExisting) @:privateAccess { - (FlxG.state.subState != null && !FlxG.state._requestSubStateReset ? FlxG.state.subState : FlxG.state).openSubState(new UIWarningSubstate("Alreadly Existing Files!!!", - "The following files alreadly exist: \n\n" + alreadlyExistingFiles.join('\n') + "\n\nIMPORTANT: OVERRIDING CAN NOT BE UNDONE!!!!!!!!", - [ { - label: "Override Files", + var buttons = [ + { + label: TU.translate("uiImageExplorer.override"), color: 0xFFFF0000, onClick: (_) -> { deleteExistingFiles(); @@ -348,10 +351,12 @@ class UIImageExplorer extends UIFileExplorer { } }, { - label: "Use Existing", + label: TU.translate("uiImageExplorer.useExisting"), onClick: (_) -> {if (onFinishSaving != null) onFinishSaving();} } - ], false)); + ]; + (FlxG.state.subState != null && !FlxG.state._requestSubStateReset ? FlxG.state.subState : FlxG.state).openSubState(new UIWarningSubstate("Alreadly Existing Files!!!", + TU.getRaw("uiImageExplorer.fileAlreadyExists").format([alreadlyExistingFiles.join('\n')]), buttons, false)); } else acuttalySaveFiles(); }