diff --git a/assets/languages/README.md b/assets/languages/README.md new file mode 100644 index 00000000..f3e8bd3f --- /dev/null +++ b/assets/languages/README.md @@ -0,0 +1,20 @@ +# Translations + +## Adding a new language + +1. Create a new folder in this folder with the language's code. Using the ISO 3166-1 codes for the language. (ex: `en` for English, `es` for Spanish, etc) (For full list of codes, see [here](https://en.wikipedia.org/wiki/ISO_3166-1#Codes)) + +2. Create a `config.ini` file in the folder with the following contents: + +```ini +name="Your Language Name in translated language" +credits="Your Name (your github username)" +version="version based on the English config.ini version" +``` + +3. Copy the xml files from the `en` (English) folder and paste them in the new folder. + +4. Translate the texts in the copied xml files. The {0} and {1}, and so on are placeholders are used for variables, and should be left as is. + +5. Make a pull request with your changes. +Make sure the pull request is labeled as `[LANG] Add ` or `[LANG] Update ` or `[LANG] Fix typo in `, generally anything is allowed but it has to contain the language name. diff --git a/assets/languages/en/Editors.xml b/assets/languages/en/Editors.xml index 35a186a0..71182b3a 100644 --- a/assets/languages/en/Editors.xml +++ b/assets/languages/en/Editors.xml @@ -34,6 +34,7 @@ Scroll Speed Strumlines $* Atleast 1 Strumline Required$ + Strumline - #{0} @@ -56,6 +57,8 @@ Edit Event Group No Event + + Strumline #{0} ({1}) diff --git a/assets/languages/en/Main.xml b/assets/languages/en/Main.xml index 0ea3b7e3..d8eff461 100644 --- a/assets/languages/en/Main.xml +++ b/assets/languages/en/Main.xml @@ -75,6 +75,27 @@ This engine is still in a *{0}* state. That means *majority of the features* are either *buggy* or *non finished*. If you find any bugs, please report them to the Codename Engine GitHub.\n\nPress {1} to continue + + + NEW UPDATE + INSTALL + SKIP + + + Preparing update installation... + Creating installation folder and cleaning old update files... + + Downloading update assets... + Downloading file {0} + + Downloading new engine executable... + Downloading {0} + + Installing new files... + Installing {0} + + + Easy Normal diff --git a/source/funkin/backend/chart/EventsData.hx b/source/funkin/backend/chart/EventsData.hx index 64b8ce93..fe19c823 100644 --- a/source/funkin/backend/chart/EventsData.hx +++ b/source/funkin/backend/chart/EventsData.hx @@ -129,7 +129,6 @@ typedef EventInfoFile = { typedef EventInfo = { var params:Array; - var paramValues:Array; } typedef EventParamInfo = { diff --git a/source/funkin/backend/system/updating/UpdateScreen.hx b/source/funkin/backend/system/updating/UpdateScreen.hx index d7da6539..66d02394 100644 --- a/source/funkin/backend/system/updating/UpdateScreen.hx +++ b/source/funkin/backend/system/updating/UpdateScreen.hx @@ -82,20 +82,20 @@ class UpdateScreen extends MusicBeatState { switch(prog.step) { case PREPARING: progressBar.value = 0; - generalProgress.text = "Preparing update installation... (1/4)"; - partProgress.text = "Creating installation folder and cleaning old update files..."; + generalProgress.text = TU.translate("updateScreen.general-1") + " (1/4)"; + partProgress.text = TU.translate("updateScreen.part-1"); case DOWNLOADING_ASSETS: progressBar.value = 1 + ((prog.curFile-1+(prog.bytesLoaded/prog.bytesTotal)) / prog.files); - generalProgress.text = "Downloading update assets... (2/4)"; - partProgress.text = 'Downloading file ${prog.curFileName}\n(${prog.curFile+1}/${prog.files} | ${CoolUtil.getSizeString(prog.bytesLoaded)} / ${CoolUtil.getSizeString(prog.bytesTotal)} | ${CoolUtil.getSizeString(lerpSpeed)}/s)'; + generalProgress.text = TU.translate("updateScreen.general-2") + " (2/4)"; + partProgress.text = TU.translate("updateScreen.part-2", [prog.curFileName]) + '\n(${prog.curFile+1}/${prog.files} | ${CoolUtil.getSizeString(prog.bytesLoaded)} / ${CoolUtil.getSizeString(prog.bytesTotal)} | ${CoolUtil.getSizeString(lerpSpeed)}/s)'; case DOWNLOADING_EXECUTABLE: progressBar.value = 2 + (prog.bytesLoaded/prog.bytesTotal); - generalProgress.text = "Downloading new engine executable... (3/4)"; - partProgress.text = 'Downloading ${prog.curFileName}\n(${CoolUtil.getSizeString(prog.bytesLoaded)} / ${CoolUtil.getSizeString(prog.bytesTotal)} | ${CoolUtil.getSizeString(lerpSpeed)}/s)'; + generalProgress.text = TU.translate("updateScreen.general-3") + " (3/4)"; + partProgress.text = TU.translate("updateScreen.part-3", [prog.curFileName]) + '\n(${CoolUtil.getSizeString(prog.bytesLoaded)} / ${CoolUtil.getSizeString(prog.bytesTotal)} | ${CoolUtil.getSizeString(lerpSpeed)}/s)'; case INSTALLING: progressBar.value = 3 + ((prog.curFile-1+(prog.curZipProgress.curFile/prog.curZipProgress.fileCount))/prog.files); - generalProgress.text = "Installing new files... (4/4)"; - partProgress.text = 'Installing ${prog.curFileName}\n(${prog.curFile}/${prog.files})'; + generalProgress.text = TU.translate("updateScreen.general-4") + " (4/4)"; + partProgress.text = TU.translate("updateScreen.part-4", [prog.curFileName]) + '\n(${prog.curFile}/${prog.files})'; } var rect = new FlxRect(0, (1 - (progressBar.value / 4)) * bf.frameHeight, bf.frameWidth, 0); rect.height = bf.frameHeight - rect.y; diff --git a/source/funkin/editors/charter/ChartCreationScreen.hx b/source/funkin/editors/charter/ChartCreationScreen.hx index 259d028d..f634bdff 100644 --- a/source/funkin/editors/charter/ChartCreationScreen.hx +++ b/source/funkin/editors/charter/ChartCreationScreen.hx @@ -117,7 +117,8 @@ class ChartCreationScreen extends UISubstateWindow { TU.translate("chartCreation.strumLineList"), [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); - strumLineList.dragCallback = (object:StrumLineButton, oldIndex:Int, newIndex:Int) -> {object.idText.text = 'Strumline - #${newIndex}';}; + var strumlineFormat = TU.getRaw("chartCreation.strumLine.format"); + strumLineList.dragCallback = (object:StrumLineButton, oldIndex:Int, newIndex:Int) -> {object.idText.text = strumlineFormat.format([newIndex]);}; scrollSpeedTextBox.onChange(scrollSpeedTextBox.label.text); saveButton = new UIButton(windowSpr.x + windowSpr.bWidth - 20 - 125, windowSpr.y + windowSpr.bHeight - 16 - 32, TU.translate("editor.saveClose"), function() { @@ -217,7 +218,7 @@ class StrumLineButton extends UIButton { charactersList.add(new CompactCharacterButton(character, subState.charFileList, charactersList)); members.push(charactersList); - idText = addLabelOn(charactersList, 'Strumline - #$id'); + idText = addLabelOn(charactersList, TU.translate("chartCreation.strumLine.format", [id])); cameraClipShader = new CustomShader("engine/cameraClip"); cameraClipShader.hset("clipRect", [0, 0, 100, 100]); diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index 75272376..2189e5af 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -119,12 +119,20 @@ class CharterEventScreen extends UISubstateWindow { if (id >= 0 && id < events.length) { curEvent = id; var curEvent = events[curEvent]; - eventName.text = curEvent.name; + + var visualName = curEvent.name; + var tuId = "charter.events." + TU.raw2Id(curEvent.name); + if(TU.exists(tuId)) + visualName = TU.translate(tuId); + + eventName.text = visualName; // add new elements var y:Float = eventName.y + eventName.height + 10; for(k=>param in EventsData.getEventParams(curEvent.name)) { function addLabel() { - var label:UIText = new UIText(eventName.x, y, 0, param.name); + var visualName = param.name; + // TODO: add translations + var label:UIText = new UIText(eventName.x, y, 0, visualName); y += label.height + 4; paramsPanel.add(label); }; @@ -152,7 +160,11 @@ class CharterEventScreen extends UISubstateWindow { numericStepper; case TStrumLine: addLabel(); - var dropdown = new UIDropDown(eventName.x, y, 320, 32, [for(k=>s in cast(FlxG.state, Charter).strumLines.members) 'Strumline #${k+1} (${s.strumLine.characters[0]})'], cast value); + var strumlineFormat = TU.getRaw("charterEventScreen.strumLine.format"); + var dropdown = new UIDropDown(eventName.x, y, 320, 32, [ + for(k=>s in cast(FlxG.state, Charter).strumLines.members) + strumlineFormat.format([k+1, s.strumLine.characters[0]]) + ], cast value); paramsPanel.add(dropdown); paramsFields.push(dropdown); dropdown; case TColorWheel: