Skip to content

Commit bbb94e6

Browse files
authored
fixes for German language (#534)
* Expand language-specific circled number support and fix translations across multiple files. * use proper plural grammar for German in ClearSpeak_Rules.yaml * Revert "Expand language-specific circled number support and fix translations across multiple files." This reverts commit 6d4716f. * . * fix "natural log" and "label"
1 parent 70f8f37 commit bbb94e6

4 files changed

Lines changed: 50 additions & 20 deletions

File tree

Rules/Languages/de/ClearSpeak_Rules.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@
630630
- if: "*[1][.='log']"
631631
then: [T: "log"]
632632
- else_if: $ClearSpeak_Log = 'LnAsNaturalLog'
633-
then: [T: "Natürliche Logarithmus"]
633+
then: [T: "natürlicher Logarithmus"]
634634
else: [spell: "'ln'"]
635635
else:
636636
- test:
@@ -640,7 +640,7 @@
640640
- if: "*[1][.='log']"
641641
then: [T: "log"]
642642
- else_if: $ClearSpeak_Log = 'LnAsNaturalLog'
643-
then: [T: "Natürliche Logarithmus"]
643+
then: [T: "natürliche Logarithmus"]
644644
else: [spell: "'ln'"]
645645
- T: "von"
646646
- pause: short
@@ -661,21 +661,36 @@
661661
- x: "$LineCount"
662662
- test:
663663
- if: "($ClearSpeak_MultiLineLabel = 'Auto' and self::m:piecewise) or $ClearSpeak_MultiLineLabel = 'Case'"
664-
then: [t: "fall"] # phrase(this is the first 'case' of three cases)
664+
then_test:
665+
if: "$LineCount = 1"
666+
then: [T: "fall"]
667+
else: [T: "fälle"]
665668
- else_if: "$ClearSpeak_MultiLineLabel = 'Auto' or $ClearSpeak_MultiLineLabel = 'Line' or $ClearSpeak_MultiLineLabel = 'None'" # already dealt with Auto/Case
666-
then: [t: "zeile"] # phrase(this is the first 'line' of three lines)
669+
then_test:
670+
if: "$LineCount = 1"
671+
then: [T: "zeile"]
672+
else: [T: "zeilen"]
667673
- else_if: "$ClearSpeak_MultiLineLabel = 'Constraint'"
668-
then: [t: "bedingung"] # phrase(this is the first 'constraint' of three constraints)
674+
then_test:
675+
if: "$LineCount = 1"
676+
then: [T: "bedingung"]
677+
else: [T: "bedingungen"]
669678
- else_if: "$ClearSpeak_MultiLineLabel = 'Equation'"
670-
then: [t: "gleichung"] # phrase(this is the first 'equation' of three equations)
679+
then_test:
680+
if: "$LineCount = 1"
681+
then: [T: "gleichung"]
682+
else: [T: "gleichungen"]
671683
- else_if: "$ClearSpeak_MultiLineLabel = 'Row'"
672-
then: [t: "reihe"] # phrase(this is the first 'row' of three rows)
684+
then_test:
685+
if: "$LineCount = 1"
686+
then: [T: "reihe"]
687+
else: [T: "reihen"]
673688
- else_if: "$ClearSpeak_MultiLineLabel = 'Step'"
674-
then: [t: "stufe"] # phrase(this is the first 'step' of three steps)
689+
then_test:
690+
if: "$LineCount = 1"
691+
then: [T: "stufe"]
692+
else: [T: "stufen"]
675693
# else 'None -- don't say anything'
676-
- test:
677-
- if: "$LineCount != 1"
678-
then: [ct: "s"] # plural # phrase(shown by the letter 's')
679694
- pause: short
680695
- x: "*"
681696
- pause: long
@@ -707,7 +722,7 @@
707722
- test:
708723
if: "self::m:mlabeledtr"
709724
then:
710-
- t: "with label" # phrase(the diagram is complete 'with label')
725+
- t: "mit Beschriftung" # phrase(the diagram is complete 'with label')
711726
- x: "*[1]/*"
712727
- test:
713728
- if: "$ClearSpeak_MultiLineLabel='None'"

tests/Languages/de/ClearSpeak/functions.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ fn normal_ln() -> Result<()> {
151151
fn simple_natural_log() -> Result<()> {
152152
let expr = "<math> <mrow> <mi>ln</mi><mi>x</mi></mrow> </math>";
153153
test_ClearSpeak("de", "ClearSpeak_Log", "LnAsNaturalLog",expr,
154-
"Natürliche Logarithmus x")?;
155-
return Ok(());
154+
"natürlicher Logarithmus x")?;
155+
Ok(())
156156

157157
}
158158

@@ -161,8 +161,8 @@ fn simple_natural_log() -> Result<()> {
161161
fn natural_log() -> Result<()> {
162162
let expr = "<math><mi>ln</mi><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo></math>";
163163
test_ClearSpeak("de", "ClearSpeak_Log", "LnAsNaturalLog",expr,
164-
"der Natürliche Logarithmus von, klammer auf x plus y, klammer zu")?;
165-
return Ok(());
164+
"der natürliche Logarithmus von, klammer auf x plus y, klammer zu")?;
165+
Ok(())
166166

167167
}
168168

@@ -565,4 +565,4 @@ fn parens_interval_neg_infinity_to_pos_infinity() -> Result<()> {
565565
return Ok(());
566566
567567
}
568-
*/
568+
*/

tests/Languages/de/ClearSpeak/multiline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn equation_auto() -> Result<()> {
4343
</math>
4444
";
4545
test_ClearSpeak("de", "ClearSpeak_MultiLineLabel", "Auto", expr,
46-
"2 zeiles; zeile 1; x plus y, ist gleich 7; zeile 2; 2 x plus 3 y; ist gleich 17")?;
46+
"2 zeilen; zeile 1; x plus y, ist gleich 7; zeile 2; 2 x plus 3 y; ist gleich 17")?;
4747
return Ok(());
4848
}
4949

@@ -195,4 +195,4 @@ fn continued_row() -> Result<()> {
195195
test("de", "SimpleSpeak", expr,
196196
"2 equations; equation 1; x is equal to y plus 1; equation 2; y is equal to 1")?;
197197
}
198-
*/
198+
*/

tests/Languages/de/mtable.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ fn determinant_1x1() -> Result<()> {
3737

3838
}
3939

40+
#[test]
41+
fn single_line_with_label() -> Result<()> {
42+
let expr = r#"<math>
43+
<mtable class="gather" displaystyle="true" intent=":system-of-equations">
44+
<mtr>
45+
<mtd intent=":equation-label"><mtext>(2)</mtext></mtd>
46+
<mtd><mi>𝑏</mi><mo>=</mo><mn>2</mn></mtd>
47+
</mtr>
48+
</mtable>
49+
</math>"#;
50+
test_prefs("de", "ClearSpeak", vec![("Verbosity", "Terse")],
51+
expr, "1 zeile, mit Beschriftung 2; b ist gleich 2")?;
52+
Ok(())
53+
}
54+
4055

4156
/*
4257
#[test]
@@ -1128,4 +1143,4 @@ fn single_line_with_label() -> Result<()> {
11281143
}
11291144
return Ok(());
11301145
1131-
*/
1146+
*/

0 commit comments

Comments
 (0)