From 775e2bb0533fa6ad0c5d05df87bffd02b7c3d5d9 Mon Sep 17 00:00:00 2001 From: Darkmet98 Date: Mon, 28 Oct 2019 19:57:45 +0100 Subject: [PATCH] :incoming_envelope: Bump to Net Core 3 --- Carto-chan/App.config | 6 -- Carto-chan/Carto-chan.csproj | 94 ++++---------------------- Carto-chan/Common.cs | 0 Carto-chan/PO.cs | 18 ++--- Carto-chan/Program.cs | 14 ++-- Carto-chan/Properties/AssemblyInfo.cs | 36 ---------- Carto-chan/TXT.cs | 7 +- Carto-chan/icon.ico | Bin Carto-chan/packages.config | 13 ---- README.md | 14 ++-- 10 files changed, 44 insertions(+), 158 deletions(-) delete mode 100755 Carto-chan/App.config mode change 100755 => 100644 Carto-chan/Carto-chan.csproj mode change 100755 => 100644 Carto-chan/Common.cs mode change 100755 => 100644 Carto-chan/PO.cs mode change 100755 => 100644 Carto-chan/Program.cs delete mode 100755 Carto-chan/Properties/AssemblyInfo.cs mode change 100755 => 100644 Carto-chan/TXT.cs mode change 100755 => 100644 Carto-chan/icon.ico delete mode 100755 Carto-chan/packages.config diff --git a/Carto-chan/App.config b/Carto-chan/App.config deleted file mode 100755 index 4bfa005..0000000 --- a/Carto-chan/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Carto-chan/Carto-chan.csproj b/Carto-chan/Carto-chan.csproj old mode 100755 new mode 100644 index 6e55af8..9c550c2 --- a/Carto-chan/Carto-chan.csproj +++ b/Carto-chan/Carto-chan.csproj @@ -1,86 +1,22 @@ - - - + + - Debug - AnyCPU - {B4D7794F-2E52-4179-B2B8-2F54C4F42D00} Exe - Carto_chan - Carto-chan - v4.7.2 - 512 - true - true - 1.1 - - 8 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - + netcoreapp3.0 icon.ico + Darkmet98 + GPL V3 + Carto_chan + TraduSquare - - - - ..\packages\System.Composition.AttributedModel.1.2.0\lib\netstandard2.0\System.Composition.AttributedModel.dll - - - ..\packages\System.Composition.Convention.1.2.0\lib\netstandard2.0\System.Composition.Convention.dll - - - ..\packages\System.Composition.Hosting.1.2.0\lib\netstandard2.0\System.Composition.Hosting.dll - - - ..\packages\System.Composition.Runtime.1.2.0\lib\netstandard2.0\System.Composition.Runtime.dll - - - ..\packages\System.Composition.TypedParts.1.2.0\lib\netstandard2.0\System.Composition.TypedParts.dll - - - - - - - - - - ..\packages\Yarhl.2.0.0-alpha.2\lib\netstandard2.0\Yarhl.dll - - - ..\packages\Yarhl.Media.2.0.0-alpha.2\lib\netstandard2.0\Yarhl.Media.dll - - - - - - - - - - - - + + + + - + + - - \ No newline at end of file + + diff --git a/Carto-chan/Common.cs b/Carto-chan/Common.cs old mode 100755 new mode 100644 diff --git a/Carto-chan/PO.cs b/Carto-chan/PO.cs old mode 100755 new mode 100644 index b713929..aca8150 --- a/Carto-chan/PO.cs +++ b/Carto-chan/PO.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Darkmet98 +// Copyright (C) 2019 Pedro Garau Martínez // // This file is part of Carto-chan. // @@ -34,27 +34,29 @@ public static void Import(string file) Po po = new BinaryFormat(new DataStream(file, FileOpenMode.Read)).ConvertTo(); //Flan code file = file.Remove(file.Length - 3); //Write file - Yarhl.IO.TextWriter writer = new Yarhl.IO.TextWriter(new DataStream(file + "x.txt", FileOpenMode.Write)); + Yarhl.IO.TextWriter writer = new Yarhl.IO.TextWriter(new DataStream(file + "_new.txt", FileOpenMode.Write)); writer.NewLine = "\r\n"; - writer.WriteLine("//GAME NAME:\t\t" + po.Header.ProjectIdVersion); + //writer.WriteLine("//GAME NAME:\t\t" + po.Header.ProjectIdVersion); foreach (var entry in po.Entries) { string potext = string.IsNullOrEmpty(entry.Translated) ? entry.Original : entry.Translated; - if (potext.IndexOf("[END]") == -1) + /*if (potext.IndexOf("[END]") == -1) { Console.WriteLine("ERROR: The string\n\n" + potext + "\n\ndoesn't contain a [END] and the game will be crash, fix it and import the po to txt again"); Environment.Exit(-1); - } + }*/ potext = potext.Replace("\n", "\\n"); if (File.Exists("Dictionary.txt")) - potext = Common.Replace(potext, Isimport); + potext = Common.Replace(potext, Isimport); + entry.Reference = entry.Reference.Substring(1); entry.Reference = entry.Reference.Replace("|", "\r\n"); - writer.WriteLine(entry.Reference); - writer.WriteLine(potext + "\r\n\r\n"); + writer.WriteLine(entry.Reference + "\r\n" + potext + "\r\n\r\n"); + //Fix on linux + writer.WriteLine(); } } } diff --git a/Carto-chan/Program.cs b/Carto-chan/Program.cs old mode 100755 new mode 100644 index 6460d8d..0d380e0 --- a/Carto-chan/Program.cs +++ b/Carto-chan/Program.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Darkmet98 +// Copyright (C) 2019 Pedro Garau Martínez // // This file is part of Carto-chan. // @@ -25,14 +25,15 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Carto-chan 1.2 - A simple converter for Cartographer TXT format to Po by Darkmet98."); + Console.WriteLine("Carto-chan 1.2 - A simple converter for Cartographer (And Atlas) TXT format to Po by Darkmet98."); + Console.WriteLine("This program is under GPL V3 license."); if (args.Length != 1 && args.Length != 2 && args.Length != 3) { - Console.WriteLine("USAGE: Carto-chan.exe <-txt/-po/credits> \"file\" \"Language\""); + Console.WriteLine("USAGE: Carto-chan <-txt/-po/credits> \"file\" \"Language\""); Console.WriteLine("If you don't specify the translation's language, the default will be \"es\"."); - Console.WriteLine("Convert TXT to Po: Carto-chan.exe -txt lb_script_001.txt en"); - Console.WriteLine("Convert Po to TXT: Carto-chan.exe -po lb_script_001.po"); - Console.WriteLine("Show the credits: Carto-chan.exe credits"); + Console.WriteLine("Convert TXT to Po: Carto-chan -txt lb_script_001.txt en"); + Console.WriteLine("Convert Po to TXT: Carto-chan -po lb_script_001.po"); + Console.WriteLine("Show the credits: Carto-chan credits"); Environment.Exit(-1); } switch (args[0]) @@ -52,7 +53,6 @@ static void Main(string[] args) Console.WriteLine("Error, the file doesn't exist"); break; case "credits": - Console.WriteLine("This program is under GPL V3 license."); Console.WriteLine("Thanks to Pleonex for Yarhl libraries."); Console.WriteLine("This logo has been originally created in its entirety by JohnSu and thus all rights belong to him."); Console.WriteLine("https://www.deviantart.com/johnsu/art/Global-Cartographer-Atlyss-560955860"); diff --git a/Carto-chan/Properties/AssemblyInfo.cs b/Carto-chan/Properties/AssemblyInfo.cs deleted file mode 100755 index 26d17c7..0000000 --- a/Carto-chan/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// La información general de un ensamblado se controla mediante el siguiente -// conjunto de atributos. Cambie estos valores de atributo para modificar la información -// asociada con un ensamblado. -[assembly: AssemblyTitle("Carto-chan")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Carto-chan")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles -// para los componentes COM. Si es necesario obtener acceso a un tipo en este ensamblado desde -// COM, establezca el atributo ComVisible en true en este tipo. -[assembly: ComVisible(false)] - -// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM. -[assembly: Guid("b4d7794f-2e52-4179-b2b8-2f54c4f42d00")] - -// La información de versión de un ensamblado consta de los cuatro valores siguientes: -// -// Versión principal -// Versión secundaria -// Número de compilación -// Revisión -// -// Puede especificar todos los valores o utilizar los números de compilación y de revisión predeterminados -// mediante el carácter '*', como se muestra a continuación: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Carto-chan/TXT.cs b/Carto-chan/TXT.cs old mode 100755 new mode 100644 index 450c432..6569b03 --- a/Carto-chan/TXT.cs +++ b/Carto-chan/TXT.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Darkmet98 +// Copyright (C) 2019 Pedro Garau Martínez // // This file is part of Carto-chan. // @@ -26,7 +26,6 @@ namespace Carto_chan class TXT { - private static string Gamename = ""; private static bool Import = false; private static string Block = ""; private static List Pointers = new List(); @@ -36,7 +35,7 @@ public static void Export(string file, string language) { Console.WriteLine("Exporting " + file + "..."); string[] textfile = System.IO.File.ReadAllLines(file); - Gamename = textfile[0].Substring(14); + //Gamename = textfile[0].Substring(14); foreach (string line in textfile) { if (line != "") @@ -74,7 +73,7 @@ private static void ToPo (string file, string language) { Po po = new Po { - Header = new PoHeader(Gamename, "fiction@email.com", language) + Header = new PoHeader("Game", "fiction@email.com", language) { LanguageTeam = "Fiction", } diff --git a/Carto-chan/icon.ico b/Carto-chan/icon.ico old mode 100755 new mode 100644 diff --git a/Carto-chan/packages.config b/Carto-chan/packages.config deleted file mode 100755 index 1df989d..0000000 --- a/Carto-chan/packages.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 4f8f890..ec67890 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ ![Carto-chan](https://raw.githubusercontent.com/TraduSquare/Carto-chan/master/logo.png) # Carto-chan -A simple converter for Cartographer TXT format to Po. +A simple converter for Cartographer (And Atlas) TXT format to Po. # Usage -Carto-chan.exe <-txt/-po/credits> "file" "language" +Carto-chan <-txt/-po/credits> "file" "language" (If you don't specify any language, the default will be "es") -* Convert TXT to Po: Carto-chan.exe -txt lb_script_001.txt en -* Convert Po to TXT: Carto-chan.exe -po lb_script_001.po -* Show the credits: Carto-chan.exe credits +* Convert TXT to Po: Carto-chan -txt lb_script_001.txt en +* Convert Po to TXT: Carto-chan -po lb_script_001.po +* Show the credits: Carto-chan credits # Changelog ## 1.0 @@ -18,6 +18,10 @@ Carto-chan.exe <-txt/-po/credits> "file" "language" * Updated Net Framework to 4.7.2 * Added a language selector when export txt to po +## 1.2 +* Updated to NET Core 3 +* Rewrited compatibility with the txt files and now support Atlas scripts + # Dictionary If you need to replace some strings (like [LINE] to \n), create a "Dictionary.txt" file on the program folder and put "Value original"="Value replaced" like this ([LINE]=\n) and Carto-chan will replace the strings. ![Dictionary](https://raw.githubusercontent.com/TraduSquare/Carto-chan/master/ExampleDictionary.png)