Skip to content

Commit 7d38fc0

Browse files
authored
Merge pull request #163 from sillsdev/txl-250-prevent-bad-affix-regex-behavior
TXL-250: Make regex helper in PhraseSubstitutionDlg behave correctly for affixes
2 parents b64f9d2 + 9fbc5a2 commit 7d38fc0

15 files changed

+2033
-1842
lines changed

DistFiles/ReleaseNotes.es.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- Se mejoró la visibilidad de las preguntas que pertenecen a una variante para poder excluir toda la variante como un grupo.
44
- Se añadió soporte para los localizadores que necesitan omitir ciertas preguntas, comentarios, respuestas y alternativas.
55
- Se añadió localización parcial al Tok Pisin (pidgin de Papúa Nueva Guinea).
6+
- Se mejoró el diseño en el cuadro de diálogo Generar Guion de Verificación para que el texto localizado quepa mejor.
7+
- Se corrigieron errores para que los controles auxiliares de expresiones regulares sean más útiles en el cuadro de diálogo Preprocesamiento para adaptar las preguntas.
68

79
## 3.1.20 9 de julio de 2024
810

DistFiles/ReleaseNotes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
- Made it easier to see when questions belong to a variant in order to exclude an entire variant as a group.
44
- Added support for localizers who need to omit certain questions, comments, answers, and alternatives.
55
- Added partial Tok Pisin localization.
6-
- Improved layout in Generate Checking Script dialog box so that localized text fits better.
6+
- Improved layout in Generate Checking Script dialog box so that localized text fits better.
7+
- Fixed bugs to make regular expression helper controls more usable in the Question Adjustments dialog box.
78

89
## 3.1.20 9 July 2024
910

Transcelerator.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
55
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UNS/@EntryIndexedValue">UNS</s:String>
66
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XML/@EntryIndexedValue">XML</s:String>
7+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=15b5b1f1_002D457c_002D4ca6_002Db278_002D5615aedc07d3/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="s_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
8+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="k" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
79
<s:Boolean x:Key="/Default/UserDictionary/Words/=analytics/@EntryIndexedValue">True</s:Boolean>
810
<s:Boolean x:Key="/Default/UserDictionary/Words/=as_0022_0029_002C_0020nul/@EntryIndexedValue">True</s:Boolean>
911
<s:Boolean x:Key="/Default/UserDictionary/Words/=attribs/@EntryIndexedValue">True</s:Boolean>

Transcelerator/PhraseSubstitutionsDlg.Designer.cs

Lines changed: 470 additions & 468 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Transcelerator/PhraseSubstitutionsDlg.cs

Lines changed: 154 additions & 171 deletions
Large diffs are not rendered by default.

Transcelerator/PhraseSubstitutionsDlg.resx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<metadata name="l10NSharpExtender1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124124
<value>114, 17</value>
125125
</metadata>
126+
<metadata name="l10NSharpExtender1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127+
<value>114, 17</value>
128+
</metadata>
126129
<metadata name="tableLayoutPanel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
127130
<value>False</value>
128131
</metadata>
@@ -148,6 +151,21 @@ If you select {1} for a row, a regular expression helper pane will appear when y
148151
<metadata name="colPreviewResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
149152
<value>True</value>
150153
</metadata>
154+
<metadata name="colMatch.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
155+
<value>True</value>
156+
</metadata>
157+
<metadata name="colReplacement.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
158+
<value>True</value>
159+
</metadata>
160+
<metadata name="colIsRegEx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
161+
<value>True</value>
162+
</metadata>
163+
<metadata name="colMatchCase.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
164+
<value>True</value>
165+
</metadata>
166+
<metadata name="colPreviewResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
167+
<value>True</value>
168+
</metadata>
151169
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
152170
<value>17, 17</value>
153171
</metadata>

Transcelerator/TextBoxWrapper.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// ---------------------------------------------------------------------------------------------
2+
#region // Copyright (c) 2025, SIL Global.
3+
// <copyright from='2025' to='2025' company='SIL Global'>
4+
// Copyright (c) 2025, SIL Global.
5+
//
6+
// Distributable under the terms of the MIT License (http://sil.mit-license.org/)
7+
// </copyright>
8+
#endregion
9+
// ---------------------------------------------------------------------------------------------
10+
using System.Windows.Forms;
11+
12+
namespace SIL.Transcelerator
13+
{
14+
/// -------------------------------------------------------------------------------------------
15+
/// <summary>
16+
/// Thin wrapper for a Windows TextBox to allow it to be used as an implementation of
17+
/// ITextWithSelection. This is simply to facilitate testing of
18+
/// <see cref="SubstitutionMatchGroup"/> in a UI-agnostic way.
19+
/// </summary>
20+
/// -------------------------------------------------------------------------------------------
21+
public class TextBoxWrapper : ITextWithSelection
22+
{
23+
private readonly TextBoxBase m_textBoxControl;
24+
25+
public TextBoxWrapper(TextBoxBase textBoxControl)
26+
{
27+
m_textBoxControl = textBoxControl;
28+
}
29+
30+
public TextBoxBase Control => m_textBoxControl;
31+
32+
public string Text
33+
{
34+
get => m_textBoxControl.Text;
35+
set => m_textBoxControl.Text = value;
36+
}
37+
38+
public int SelectionStart
39+
{
40+
get => m_textBoxControl.SelectionStart;
41+
set => m_textBoxControl.SelectionStart = value;
42+
}
43+
44+
public int SelectionLength
45+
{
46+
get => m_textBoxControl.SelectionLength;
47+
set => m_textBoxControl.SelectionLength = value;
48+
}
49+
50+
public string SelectedText
51+
{
52+
get => m_textBoxControl.SelectedText;
53+
}
54+
}
55+
}

Transcelerator/Transcelerator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@
308308
<Compile Include="AddRenderingDlg.Designer.cs">
309309
<DependentUpon>AddRenderingDlg.cs</DependentUpon>
310310
</Compile>
311+
<Compile Include="TextBoxWrapper.cs" />
311312
<Compile Include="VariantQuestionInfoDlg.cs">
312313
<SubType>Form</SubType>
313314
</Compile>

0 commit comments

Comments
 (0)