Skip to content

Commit

Permalink
Merge branch 'master' into feature/netflix-glyph-check
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-belenko authored Dec 27, 2016
2 parents 6271d8a + de4a82a commit 7b87bcf
Show file tree
Hide file tree
Showing 62 changed files with 910 additions and 731 deletions.
11 changes: 10 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
Subtitle Edit Changelog

3.5.1 (xth December 2016) BETA
3.5.1 (13th December 2016)
* NEW:
* "mpv" media player now works on Linux - thx var1ap
* Added new subtitle format - thx Siavash
* Added new export format "EDL/ClipName" - thx alex
* IMPROVED:
* Updated Hungarian translation - thx ZityiSoft Team
* Updated Russian translation - thx Elheym
* Updated Romanian translation - thx Mircea
* Updated Finnish translation - thx Teijo
* Updated French Translation - thx JM GBT
* Updated Bulgarian Translation - thx Maknol
* Updated Chinese translation - thx Leon/tinyboxvk
* Language auto-detect now includes Latvian and Lithuanian - thx rhazor
* Added "Custom text format" in "Batch convert" - thx Chamallow
* "EBU stl" now only prompt for settings in "Save as..." - thx Debora
* FIXED:
* Fixed libre office spell checking urls - thx Massaguana
* Fixed possible crash when generating scene changes - thx Leemet
* Fixed issues with moving rules in "Multiple replace" - thx kristiaanvk
* Fixed list view issues regarding remember selected position - thx darnn
Expand All @@ -26,6 +31,10 @@
* Fix two issues with "Fix common errors" - thx Tronar
* OCR fix rules: fix for weird Unicode comma (#x201A) - thx djc
* Fixed some issues with "Save original as..." - thx Stefan
* Fix for "DVD Studio Pro" italic handling - thx Sean
* Fixed saving correct value in "Delete auto-backup after months" - thx Elheym
* Fixed buggy ELR time code parsing - thx darnn
* Fixed overlap bug in auto-duration - thx rebawest


3.5 (26th October 2016)
Expand Down
57 changes: 56 additions & 1 deletion Dictionaries/eng_OCRFixReplaceList.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<OCRFixReplaceList>
<?xml version="1.0" encoding="utf-8"?>
<OCRFixReplaceList>
<WholeWords>
<Word from="$COff$" to="scoffs" />
<Word from="$ergei" to="Sergei" />
Expand Down Expand Up @@ -1863,6 +1864,60 @@
<Word from="yourplanet" to="your planet" />
<Word from="matteryour" to="matter your" />
<Word from="Yourplace" to="Your place" />
<Word from="andjustice" to="and justice" />
<Word from="anotherpart" to="another part" />
<Word from="confiict" to="conflict" />
<Word from="growingjeopardy" to="growing jeopardy" />
<Word from="hasjust" to="has just" />
<Word from="havejust" to="have just" />
<Word from="herselfinto" to="herself into" />
<Word from="ifnecessary" to="if necessary" />
<Word from="we'vejust" to="we've just" />
<Word from="tojust" to="to just" />
<Word from="yourjudgment" to="your judgment" />
<Word from="yourjeans" to="your jeans" />
<Word from="Youjust" to="You just" />
<Word from="ajanitor" to="a janitor" />
<Word from="FIattery" to="Flattery" />
<Word from="myjournal" to="my journal" />
<Word from="myjudgment" to="my judgment" />
<Word from="offofmy" to="off of my" />
<Word from="offyour" to="off your" />
<Word from="ofgood" to="of good" />
<Word from="ofguilty" to="of guilty" />
<Word from="ofhaving" to="of having" />
<Word from="ofheart" to="of heart" />
<Word from="ofhonor" to="of honor" />
<Word from="oflove" to="of love" />
<Word from="ofmankind" to="of mankind" />
<Word from="ofmany" to="of many" />
<Word from="ofnormal" to="of normal" />
<Word from="ofpeople" to="of people" />
<Word from="ofpower" to="of power" />
<Word from="ofsuch" to="of such" />
<Word from="peoplejust" to="people just" />
<Word from="They'rejust" to="They're just" />
<Word from="tojeopardize" to="to jeopardize" />
<Word from="Yourplaces" to="Your places" />
<Word from="yourposition" to="your position" />
<Word from="yourselfa" to="yourself a" />
<Word from="yourselfright" to="yourself right" />
<Word from="thejob" to="the job" />
<Word from="thejanitors" to="the janitors" />
<Word from="alljust" to="all just" />
<Word from="forAmerica's" to="for America's" />
<Word from="Forpencils" to="For pencils" />
<Word from="forpondering" to="for pondering" />
<Word from="handwrittenjournals" to="handwritten journals" />
<Word from="herpursuit" to="her pursuit" />
<Word from="ofjust" to="of just" />
<Word from="oflanding" to="of landing" />
<Word from="oflife" to="of life" />
<Word from="outjust" to="out just" />
<Word from="Thejoke" to="The joke" />
<Word from="ourpatient" to="our patient" />
<Word from="oryou're" to="or you're" />
<Word from="ofyourself" to="of yourself" />
</WholeWords>
<PartialWordsAlways>
<!-- Will be replaced always -->
Expand Down
20 changes: 17 additions & 3 deletions Dictionaries/hrv_OCRFixReplaceList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<Word from="ćale" to="tata" />
<Word from="ćaletom" to="ocem" />
<Word from="ćaleta" to="oca" />
<Word from="ćaletu" to="ocu" />
<Word from="ćorsokak" to="slijepa ulica" />
<Word from="ćorsokaku" to="slijepoj ulici" />
<Word from="ćošak" to="ugao" />
Expand All @@ -75,6 +76,7 @@
<Word from="Ćerka" to="Kći" />
<Word from="ćmo" to="ćemo" />
<Word from="ćte" to="ćete" />
<Word from="čuće" to="čut će" />
<Word from="ćutao" to="šutio" />
<Word from="Ćutao" to="Šutio" />
<Word from="daga" to="da ga" />
Expand Down Expand Up @@ -143,6 +145,7 @@
<Word from="hoču" to="hoću" />
<Word from="Hoču" to="Hoću" />
<Word from="hteće" to="htjet će" />
<Word from="htedoh" to="htjedoh" />
<Word from="iči" to="ići" />
<Word from="Iči" to="Ići" />
<Word from="iko" to="itko" />
Expand All @@ -160,6 +163,7 @@
<Word from="ivici" to="rubu" />
<Word from="ivicu" to="rub" />
<Word from="isuviše" to="previše" />
<Word from="isterao" to="istjerao" />
<Word from="izgladneo" to="izgladnio" />
<Word from="izmeriti" to="izmjeriti" />
<Word from="izvinim" to="ispričam" />
Expand Down Expand Up @@ -363,6 +367,7 @@
<Word from="ovjde" to="ovdje" />
<Word from="Ovjde" to="Ovdje" />
<Word from="palate" to="palače" />
<Word from="palatu" to="palaču" />
<Word from="palati" to="palači" />
<Word from="pantalone" to="hlače" />
<Word from="parče" to="komadić" />
Expand Down Expand Up @@ -564,6 +569,9 @@
<Word from="sudijskog" to="sudskog" />
<Word from="sugerišu" to="predlažu" />
<Word from="sugeriše" to="predlaže" />
<Word from="surfuje" to="surfa" />
<Word from="surfuješ" to="surfaš" />
<Word from="surfuju" to="surfaju" />
<Word from="suština" to="bit" />
<Word from="suštinski" to="bitni" />
<Word from="svestan" to="svjestan" />
Expand Down Expand Up @@ -622,6 +630,7 @@
<Word from="uljeva" to="ulijeva" />
<Word from="u jutro" to="ujutro" />
<Word from="ujutru" to="ujutro" />
<Word from="ume" to="zna" />
<Word from="umem" to="umijem" />
<Word from="umeš" to="umiješ" />
<Word from="umesto" to="umjesto" />
Expand Down Expand Up @@ -658,6 +667,7 @@
<Word from="večan" to="vječan" />
<Word from="vek" to="stoljeće" />
<Word from="veka" to="stoljeća" />
<Word from="veke" to="vijeke" />
<Word from="vekova" to="stoljeća" />
<Word from="venca" to="vijenca" />
<Word from="večnost" to="vječnost" />
Expand Down Expand Up @@ -735,6 +745,7 @@
<Word from="Niče" to="Nietzsche" />
<Word from="Ohajo" to="Ohio" />
<Word from="Pem" to="Pam" />
<Word from="Pejdž" to="Paige" />
<Word from="Rejčel" to="Rachel" />
<Word from="Stejt" to="State" />
<Word from="Šeron" to="Sharon" />
Expand Down Expand Up @@ -792,6 +803,7 @@
<LinePart from="biti uredu" to="biti u redu" />
<LinePart from="bi da bude" to="bi biti" />
<LinePart from="Bi ste" to="Biste" />
<LinePart from="će da dođe" to="će doći" />
<LinePart from="Dobro veče" to="Dobra večer" />
<LinePart from="Dobro večer" to="Dobra večer" />
<LinePart from="Dobar večer" to="Dobra večer" />
Expand Down Expand Up @@ -836,6 +848,7 @@
<LinePart from="zato sto" to="zato što" />
<LinePart from="želim da budem" to="želim biti" />
<LinePart from="Želim da budem" to="Želim biti" />
<LinePart from="želiš da budeš" to="želiš biti" />
</PartialLines>
<PartialLinesAlways />
<BeginLines />
Expand Down Expand Up @@ -1373,7 +1386,7 @@
<RegEx find="ustić([eu])" replaceWith="ustit ć$1" />
<RegEx find="put[ae]?r" replaceWith="maslac" />
<RegEx find="Put[ae]?r" replaceWith="Maslac" />
<RegEx find="([rR])a([dn])ić([eu])" replaceWith="$1a$2it ć$3" />
<RegEx find="(?&lt;!g)([rR])a([dn])ić([eu])" replaceWith="$1a$2it ć$3" />
<RegEx find="atosilja" replaceWith="iješi" />
<RegEx find="azme([nr])" replaceWith="azmje$1" />
<RegEx find="azumi?j?eć" replaceWith="azumjet ć" />
Expand Down Expand Up @@ -1611,6 +1624,7 @@
<RegEx find="\bvereni([ckč])" replaceWith="zaručni$1" />
<RegEx find="\bVereni([ckč])" replaceWith="Zaručni$1" />
<RegEx find="\b([vV])j?est(i|ima)?\b" replaceWith="$1ijest$2" />
<RegEx find="([vV])ešanj" replaceWith="$1ješanj" />
<RegEx find="([vV])ešt" replaceWith="$1ješt" />
<RegEx find="\b([vV])j?en(ac|c[aeiu]m?)" replaceWith="$1ijen$2" />
<RegEx find="\b([vV])enčan" replaceWith="$1jenčan" />
Expand Down Expand Up @@ -1797,7 +1811,6 @@
<RegEx find="(?&lt;!k)rimić" replaceWith="rimit ć" />
<RegEx find="prostav" replaceWith="protstav" />
<RegEx find="pulis" replaceWith="pulir" />
<RegEx find="(?&lt;!g)radić" replaceWith="radit ć" />
<RegEx find="r([mv])isan" replaceWith="r$1iran" />
<RegEx find="rviši" replaceWith="rviraj" />
<RegEx find="ržać" replaceWith="ržat ć" />
Expand Down Expand Up @@ -1840,6 +1853,7 @@
<RegEx find="ulišu" replaceWith="uliraju" />
<RegEx find="umere" replaceWith="umjere" />
<RegEx find="upoce" replaceWith="upocje" />
<RegEx find="urfovan" replaceWith="urfan" />
<RegEx find="(?&lt;!kr|m)užić" replaceWith="užit ć" />
<RegEx find="veri([lt])" replaceWith="vjeri$1" />
<RegEx find="visić" replaceWith="visit ć" />
Expand Down Expand Up @@ -1912,7 +1926,7 @@
<RegEx find="Kembridž" replaceWith="Cambridge" />
<RegEx find="Konn?ektik[aeu]t" replaceWith="Connecticut" />
<RegEx find="Korejan" replaceWith="Korej" />
<RegEx find="Kris" replaceWith="Chris" />
<RegEx find="Kris(?!t)" replaceWith="Chris" />
<RegEx find="Lajonel" replaceWith="Lionel" />
<RegEx find="Leri" replaceWith="Larry" />
<RegEx find="(?&lt;![LT])ejl" replaceWith="ale" />
Expand Down
2 changes: 1 addition & 1 deletion LanguageMaster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Language Name="English">
<General>
<Title>Subtitle Edit</Title>
<Version>3.5.0</Version>
<Version>3.5.1</Version>
<TranslatedBy>Translated by Nikse</TranslatedBy>
<CultureName>en-US</CultureName>
<HelpFile />
Expand Down
2 changes: 1 addition & 1 deletion libse/Properties/AssemblyInfo.cs.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("eab3b9db-0f82-4843-982b-05a4c51888a2")]
[assembly: AssemblyVersion("3.5.0.[REVNO]")]
[assembly: AssemblyVersion("3.5.1.[REVNO]")]

[assembly: InternalsVisibleTo("Test")]
2 changes: 1 addition & 1 deletion libse/SubtitleFormats/DvdStudioPro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ internal static string EncodeStyles(string text)
text = text.Replace("</B>", "^B");

if (allItalic)
return text.Replace(Environment.NewLine, "|^I");
return text.Replace(Environment.NewLine, "^I|^I");
return text.Replace(Environment.NewLine, "|");
}

Expand Down
9 changes: 5 additions & 4 deletions libse/SubtitleFormats/ELRStudioClosedCaption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ private static TimeCode GetTimeCode(byte[] buffer, int idx)
{
try
{
var frames = buffer[idx];
var seconds = buffer[idx + 1];
var minutes = buffer[idx + 2];
var hours = buffer[idx + 3];
const string format = "X4";
int frames = int.Parse(buffer[idx].ToString(format));
int seconds = int.Parse(buffer[idx + 1].ToString(format));
int minutes = int.Parse(buffer[idx + 2].ToString(format));
int hours = int.Parse(buffer[idx + 3].ToString(format));
return new TimeCode(hours, minutes, seconds, FramesToMillisecondsMax999(frames));
}
catch
Expand Down
15 changes: 11 additions & 4 deletions libse/SubtitleFormats/Ebu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@ public bool Save(string fileName, Subtitle subtitle)
return Save(fileName, subtitle, false);
}

public bool Save(string fileName, Subtitle subtitle, bool batchMode)
public bool Save(string fileName, Subtitle subtitle, bool batchMode, EbuGeneralSubtitleInformation header = null)
{
using (var ms = new MemoryStream())
{
var ok = Save(fileName, ms, subtitle, batchMode);
var ok = Save(fileName, ms, subtitle, batchMode, header);
if (ok)
{
ms.Position = 0;
Expand All @@ -547,9 +547,11 @@ public bool Save(string fileName, Subtitle subtitle, bool batchMode)
}
}

public bool Save(string fileName, Stream stream, Subtitle subtitle, bool batchMode)
public bool Save(string fileName, Stream stream, Subtitle subtitle, bool batchMode, EbuGeneralSubtitleInformation header)
{
var header = new EbuGeneralSubtitleInformation();
if (header == null)
header = new EbuGeneralSubtitleInformation();

if (EbuUiHelper == null)
return false;

Expand Down Expand Up @@ -1258,5 +1260,10 @@ public override bool IsTextBased
}
}

public bool Save(string fileName, Stream stream, Subtitle subtitle, bool batchMode)
{
return Save(fileName, stream, subtitle, batchMode, null);
}

}
}
24 changes: 12 additions & 12 deletions libse/SubtitleFormats/Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@ public override bool IsMine(List<string> lines, string fileName)

public static string EncodeJsonText(string text)
{
var sb = new StringBuilder();
var sb = new StringBuilder(text.Length);
foreach (var c in text)
{
if (c == '"')
{
sb.Append("\\\"");
}
else if (c == '\\')
switch (c)
{
sb.Append("\\\\");
}
else
{
sb.Append(c);
case '\\':
sb.Append("\\\\");
break;
case '"':
sb.Append("\\\"");
break;
default:
sb.Append(c);
break;
}
}
return sb.ToString().Replace(Environment.NewLine, "<br />");
}

public static string DecodeJsonText(string text)
{
var sb = new StringBuilder();
text = text.Replace("<br />", Environment.NewLine);
text = text.Replace("<br>", Environment.NewLine);
text = text.Replace("<br/>", Environment.NewLine);
text = text.Replace("\\n", Environment.NewLine);
bool keepNext = false;
var sb = new StringBuilder(text.Length);
foreach (var c in text)
{
if (c == '\\' && !keepNext)
Expand Down
11 changes: 9 additions & 2 deletions libse/SubtitleFormats/JsonType9.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
/// <summary>
/// CBTNuggets, e.g. https://portal.cbtnuggets.com/mediav2/caption/54f4cf34fcb8f7d56e0001bf_10x.json
/// </summary>
public class JsonType9 : SubtitleFormat
{
public override string Extension
Expand Down Expand Up @@ -68,10 +71,10 @@ public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string
foreach (string s in lines)
sb.Append(s);
var allText = sb.ToString().Trim();
if (!allText.StartsWith("[", StringComparison.Ordinal) || !allText.Contains("\"index\""))
if (!allText.StartsWith("[", StringComparison.Ordinal) || !allText.Contains("\"start\""))
return;

foreach (var line in Json.ReadObjectArray(allText)) //allText.Split('{', '}', '[', ']'))
foreach (var line in Json.ReadObjectArray(allText))
{
var s = line.Trim();
if (s.Length > 10)
Expand All @@ -81,6 +84,10 @@ public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string
var textLines = Json.ReadArray(s, "text");
try
{
if (textLines.Count == 0)
{
_errorCount++;
}
sb.Clear();
foreach (var textLine in textLines)
{
Expand Down
Loading

0 comments on commit 7b87bcf

Please sign in to comment.