Skip to content

Commit

Permalink
📨 Bump to Net Core 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkmet98 committed Oct 28, 2019
1 parent b66f5bf commit 775e2bb
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 158 deletions.
6 changes: 0 additions & 6 deletions Carto-chan/App.config

This file was deleted.

94 changes: 15 additions & 79 deletions Carto-chan/Carto-chan.csproj
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,86 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B4D7794F-2E52-4179-B2B8-2F54C4F42D00}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Carto_chan</RootNamespace>
<AssemblyName>Carto-chan</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<ReleaseVersion>1.1</ReleaseVersion>
<TargetFrameworkProfile />
<LangVersion>8</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Authors>Darkmet98</Authors>
<Copyright>GPL V3</Copyright>
<RootNamespace>Carto_chan</RootNamespace>
<Company>TraduSquare</Company>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Composition.AttributedModel, Version=1.0.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Composition.AttributedModel.1.2.0\lib\netstandard2.0\System.Composition.AttributedModel.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Convention, Version=1.0.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Composition.Convention.1.2.0\lib\netstandard2.0\System.Composition.Convention.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Hosting, Version=1.0.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Composition.Hosting.1.2.0\lib\netstandard2.0\System.Composition.Hosting.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Runtime, Version=1.0.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Composition.Runtime.1.2.0\lib\netstandard2.0\System.Composition.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Composition.TypedParts, Version=1.0.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Composition.TypedParts.1.2.0\lib\netstandard2.0\System.Composition.TypedParts.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Yarhl, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Yarhl.2.0.0-alpha.2\lib\netstandard2.0\Yarhl.dll</HintPath>
</Reference>
<Reference Include="Yarhl.Media, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Yarhl.Media.2.0.0-alpha.2\lib\netstandard2.0\Yarhl.Media.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Common.cs" />
<Compile Include="PO.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TXT.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />

<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>

<ItemGroup>
<Content Include="icon.ico" />
<PackageReference Include="Yarhl" Version="2.0.0.1" />
<PackageReference Include="Yarhl.Media" Version="2.0.0.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
Empty file modified Carto-chan/Common.cs
100755 → 100644
Empty file.
18 changes: 10 additions & 8 deletions Carto-chan/PO.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2018 Darkmet98
// Copyright (C) 2019 Pedro Garau Martínez
//
// This file is part of Carto-chan.
//
Expand Down Expand Up @@ -34,27 +34,29 @@ public static void Import(string file)
Po po = new BinaryFormat(new DataStream(file, FileOpenMode.Read)).ConvertTo<Po>(); //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();
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions Carto-chan/Program.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2018 Darkmet98
// Copyright (C) 2019 Pedro Garau Martínez
//
// This file is part of Carto-chan.
//
Expand All @@ -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])
Expand All @@ -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");
Expand Down
36 changes: 0 additions & 36 deletions Carto-chan/Properties/AssemblyInfo.cs

This file was deleted.

7 changes: 3 additions & 4 deletions Carto-chan/TXT.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2018 Darkmet98
// Copyright (C) 2019 Pedro Garau Martínez
//
// This file is part of Carto-chan.
//
Expand Down Expand Up @@ -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<string> Pointers = new List<string>();
Expand All @@ -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 != "")
Expand Down Expand Up @@ -74,7 +73,7 @@ private static void ToPo (string file, string language)
{
Po po = new Po
{
Header = new PoHeader(Gamename, "[email protected]", language)
Header = new PoHeader("Game", "[email protected]", language)
{
LanguageTeam = "Fiction",
}
Expand Down
Empty file modified Carto-chan/icon.ico
100755 → 100644
Empty file.
13 changes: 0 additions & 13 deletions Carto-chan/packages.config

This file was deleted.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 775e2bb

Please sign in to comment.