Commit Graph

17793 Commits

Author SHA1 Message Date
Ivandro Jao
dc619fde88 Add false condition test in StringExtensionsTest
A new test case was added in the 'StringExtensionsTest.cs' to check a scenario where a string does not end with a sentence-ending punctuation. This is essential to ensure the 'HasSentenceEnding()' method handles such scenarios accurately.
2023-07-27 12:36:22 +01:00
Ivandro Jao
7d1710210f Add sentence ending checks for italicized strings
This update adds additional test cases in the StringExtensionsTest to ensure sentence ending detection works on italicized strings, both with and without additional HTML font tags. This change will ensure proper sentence ending checks within our text parsing logic.
2023-07-27 12:34:46 +01:00
Ivandro Jao
29b90fc704 "Extend html tag detection to include assa tags in StringExtensions
Previously, only html closing tags (e.g., </i>, </font>) were handled when checking for adjacent sentence-ending characters. This change extends the detection to include assa closing tags (e.g., {\\i0}), improving string manipulation efficiency. This modification will increase the readability and correctness of extracted strings in diverse tag environments."
2023-07-27 12:34:36 +01:00
Ivandro Jao
adc8fe703e "Relocate culture evaluation logic in StringExtensions
The culture type evaluation logic was moved to a more suitable location in the code within the StringExtensions file. This change ensures that the culture type is assessed only when it's necessary, avoiding unnecessary operations and leading to optimized performance."
2023-07-27 12:16:14 +01:00
Ivandro Jao
b27dc60631 Update string extension tests for sentence endings
This commit updates the unit tests in StringExtensionsTest.cs to account for more cases of sentence endings. The original tests did not account for edge cases such as having an italic closing tag or an em dash before the end of the sentence which can also signify the end of a sentence. Additionally, corrected an erroneous test that claimed an empty string has a sentence ending, which it doesn't.
2023-07-27 12:15:40 +01:00
Ivandro Jao
51c3df0416 "Refactor index checks in StringExtensions.cs
This commit changes the index checks in the hyphen and em dash conditions within StringExtensions.cs. Previously, these checks were made at the length (len) of the string value. This could result in inaccurate evaluations, especially for strings with length less than 3 for hyphens and length less than 2 for em dashes. Now, checks are made against 'checkIndex' which should provide more accurate evaluations regardless of the string length."
2023-07-27 12:15:10 +01:00
Ivandro Jao
d6e72c7c8e Fix return value in StringExtensions
Changed the return value in the StringExtensions when the string is null or empty. Previously, the function returned true when encountering an empty string which contradicted with its intended behaviour. Now, it correctly returns false when the input string is empty or null, ensuring consistent and reliable usage in future code.
2023-07-27 11:52:50 +01:00
Martijn van Berkel (Flitskikker)
62c535f0fc Sneak in a quick Dutch translation fix 2023-07-26 20:54:45 +02:00
Martijn van Berkel (Flitskikker)
973dfa3fb1 Also make sure chaining behavior combobox dropdown items fit 2023-07-26 20:49:29 +02:00
Martijn van Berkel (Flitskikker)
94e3843a6b Ditto 2023-07-26 20:42:21 +02:00
Martijn van Berkel (Flitskikker)
755cf627a3 Fix another cut off string on Import shot changes dialog 2023-07-26 20:37:15 +02:00
Martijn van Berkel (Flitskikker)
38ff002c93 Improve "Simple mode" dialog layout for too long texts 2023-07-26 20:33:25 +02:00
Juan M. Araújo
0f4d6a74fd
[VideoPlayerContainer] Fix Pause button coordinates 2023-07-26 14:50:41 -03:00
Nikolaj Olsson
647fb81ba0
Merge pull request #7161 from hugok79/patch-100
Update pt-PT.xml
2023-07-26 12:59:31 -04:00
Martijn van Berkel (Flitskikker)
3eccdcec71 Reset dialog style to prevent failing tests 2023-07-26 18:14:25 +02:00
Martijn van Berkel (Flitskikker)
67e7cdc56a Merge branch 'master' into feature/fit-one-line-pixel-width 2023-07-26 18:10:35 +02:00
Hugo Carvalho
e407c6cd36
Update pt-PT.xml
Some grammar corrections.
2023-07-26 11:45:01 +01:00
niksedk
6a7c09a3a6 Update "BeautifyTimeCodes" toolbar icons - thx jmaraujouy :)
See https://github.com/SubtitleEdit/subtitleedit/discussions/6921#discussioncomment-6543902
2023-07-25 21:17:26 +02:00
Martijn van Berkel (Flitskikker)
6cc1e1468a Merge branch 'master' into feature/fit-one-line-pixel-width
# Conflicts:
#	src/ui/Forms/FixCommonErrors.cs
2023-07-25 21:02:59 +02:00
niksedk
831faa71d2 Update change log 2023-07-25 20:11:32 +02:00
niksedk
7d4f9395e1 Update Whisper Const-me to version 1.12
https://github.com/Const-me/Whisper/releases/tag/1.12.0
2023-07-25 19:40:52 +02:00
niksedk
513b0b9a0a Fix crash in OCR/Find - thx przemo20 :)
Fix #7155
2023-07-25 19:36:26 +02:00
niksedk
ccb3a6094f Fix possible crash in "Fix common errors" - thx darnn :)
Fix #7146
2023-07-25 17:22:02 +02:00
Μητσάκης Παναγιώτης
2a2fc1dcaa
Merge branch 'SubtitleEdit:main' into main 2023-07-25 08:56:58 +03:00
Μητσάκης Παναγιώτης
561175d109
Added to the correct directory 2023-07-25 08:56:32 +03:00
Μητσάκης Παναγιώτης
648552b872
Delete el-GR.xml 2023-07-25 08:55:24 +03:00
niksedk
a784236846 Fix invanted NikseUpDown ValueChanged event 2023-07-25 07:08:39 +02:00
Nikolaj Olsson
19435e4d53
Merge pull request #7153 from hugok79/patch-99
Update pt-PT.xml
2023-07-24 15:18:53 -04:00
niksedk
2c3f73f68b Minor fixes for last commit 2023-07-24 21:17:26 +02:00
Nikolaj Olsson
99fe3a777f
Merge pull request #7154 from ivandrofly/feature/fixcomonerrors-description
Update FixCommonErrors with explicit descriptions
2023-07-24 15:14:42 -04:00
Ivandro Jao
b062e749c8 Update FixCommonErrors with explicit descriptions
Several FixItem descriptions were updated in the FixCommonErrors.cs source file with clear and specific examples of what each fix does. This will help users understand the changes that are being performed on their subtitles, leading to enhanced usability and a better user experience. This change does not affect functionality, it solely enriches the user interface with more informative text.
2023-07-24 19:12:16 +01:00
niksedk
bfc1a339cf More Hebrew language auto detect words 2023-07-24 20:10:23 +02:00
Hugo Carvalho
f44deaf6e7
Update pt-PT.xml 2023-07-24 18:53:38 +01:00
niksedk
d2a6a609d6 Fix crash when generating empty wav file for online video - thx Gromko1111 :)
Fix #7140
2023-07-24 19:49:53 +02:00
niksedk
521fb05c1d Fix mkv in batch-convert 2023-07-24 16:31:24 +02:00
niksedk
7622aaf5f0 Minor fix 2023-07-24 15:52:06 +02:00
niksedk
d9f8851b91 Update Bulgarian translation - thx Калин :) 2023-07-24 15:34:09 +02:00
Nikolaj Olsson
69dbc97473
Merge pull request #7152 from Flitskikker/feature/fix-20230724
Fix for #7151
2023-07-24 06:55:00 -04:00
Martijn van Berkel (Flitskikker)
ad93f0f6f2 Fix for #7151 2023-07-24 10:16:18 +02:00
niksedk
4e898c62ac Minor UI fixes 2023-07-24 05:41:01 +02:00
niksedk
8c07f7339b Testing a bit more... 2023-07-24 05:07:37 +02:00
niksedk
a31fac563a Do not call onpaint as much... 2023-07-24 05:02:32 +02:00
Ivandro Jao
08f07d968f Add tests for HasSentenceEnding functionality
Additional unit tests have been added for the HasSentenceEnding method in the StringExtensions class. The tests focus on verifying the method's functionality in both culture-neutral scenarios and specific to Greek culture. This is to ensure reliable string analyses across various usage contexts.
2023-07-24 00:33:14 +01:00
Ivandro Jao
13c0b52946 Refactor OcrFixEngine to improve readability
Replaced repetitive 'endingBeforeThis' checks with a new method call 'lastLine.HasSentenceEnding()', improving readability and maintainability. This method encapsulates the logic for checking if the last line has sentence ending punctuation, improving code organization and ensuring consistent behavior.
2023-07-24 00:24:14 +01:00
Ivandro Jao
3520d336a0 Refactor string sentence ending check logic
StringExtensions.cs has been refactored to separate different language sentence ending checks. The previous implementation combined all checks in a single control flow, which was less readable. Now, neutral languages and Greek language have separate check containers. The adjustment also better handles cases when sentence ending character is adjacent with HTML closing tags. This not only improves the readability of the code but also enhances its maintainability.
2023-07-24 00:23:46 +01:00
niksedk
0eaa058ba7 Only use invalidate 2023-07-23 21:15:50 +02:00
niksedk
47df52c61e Use local var 2023-07-23 21:06:07 +02:00
niksedk
7cf8ea11a8 Try to improve performance a little 2023-07-23 21:01:25 +02:00
niksedk
297423f4c3 Try to fix auto-save issue 2023-07-23 20:42:25 +02:00
niksedk
551e3ab3a8 Minor clean 2023-07-23 20:07:23 +02:00