diff --git a/scripts/docs-i18n/doc_mode_test.go b/scripts/docs-i18n/doc_mode_test.go index 939855b592dd..72fe808a2d53 100644 --- a/scripts/docs-i18n/doc_mode_test.go +++ b/scripts/docs-i18n/doc_mode_test.go @@ -2697,8 +2697,8 @@ func TestValidateDocBodyRejectsChangedCompositeLiteral(t *testing.T) { func TestExtractNumericValuesKeepsLowAmbiguityComposites(t *testing.T) { t.Parallel() - got := strings.Join(extractNumericValues("0xFF 0b101 0o755 1.5:1 24/7 1e-3 v1.2.3 v24/7 24/7z"), ",") - if want := "0xFF,0b101,0o755,1.5:1,24/7,1e-3"; got != want { + got := strings.Join(extractNumericValues("0xFF 0b101 0o755 1.5:1 24/7 1e-3 v1.2.3 v24/7 24/7z Hailuo-2.3/02"), ",") + if want := "0xFF,0b101,0o755,1.5:1,24/7,1e-3,2.3/02"; got != want { t.Fatalf("unexpected composite literals: got=%q want=%q", got, want) } if err := validateDocChunkTranslation("Supports 1:1 conversations.\n", "Unterstützt 1:1-Unterhaltungen.\n"); err != nil { @@ -2707,6 +2707,9 @@ func TestExtractNumericValuesKeepsLowAmbiguityComposites(t *testing.T) { if err := validateDocChunkTranslation("Available 24/7.\n", "24/7 उपलब्ध।\n"); err != nil { t.Fatalf("expected translated prose around exact slash ratio to pass: %v", err) } + if err := validateDocChunkTranslation("Hailuo 2.3/02 models.\n", "Hailuo-2.3/02-Modelle.\n"); err != nil { + t.Fatalf("expected locale hyphen compound around exact ratio to pass: %v", err) + } } func TestExtractNumericValuesKeepsClockCoreBeforeMeridiemSuffix(t *testing.T) { diff --git a/scripts/docs-i18n/masking.go b/scripts/docs-i18n/masking.go index 942b4746ec9e..12ba457f37f1 100644 --- a/scripts/docs-i18n/masking.go +++ b/scripts/docs-i18n/masking.go @@ -354,7 +354,7 @@ func hasCompositeNumericLeadingContinuation(text string, position int) bool { } return position > 0 && isCompositeNumericWordByte(text[position-1]) } - return value == '.' || value == '-' || isCompositeNumericWordByte(value) + return value == '.' || isCompositeNumericWordByte(value) } func hasCompositeNumericContinuation(text string, position int) bool {