Dictionary files cannot have differing sentence counts.

Pál Orosz 20 Reputation points
2025-06-16T15:22:18.72+00:00

Hello,

I have a unique set of source language phrases and equal rows of English phrases.
I would upload them as Phrase dictionary in the Custom Translator, yet it fails with these message:

Dictionary files cannot have differing sentence counts.

I checked and have no duplicates in the source rows, and the txt files have exactly the same rows.
Your advice would be greatly appreciated.

Azure AI Translator
Azure AI Translator
An Azure service to easily conduct machine translation with a simple REST API call.
484 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alex Burlachenko 9,780 Reputation points
    2025-06-17T10:36:59.6733333+00:00

    hi therePál Orosz, thanks for posting this on the Q&A

    for azure custom translator, the key here is that every single line in both source and target files must match 1:1. even if u think they're identical, hidden characters or encoding issues can mess things up. open both files in a plain text editor like notepad++ (not word, never word %) and check line by line.

    try that one ... save the files as UTF-8 BOM. sometimes that sneaky encoding difference trips up the validator. also, remove any trailing empty lines, yes, even one extra space can cause this error ))

    now, for general advice that works anywhere... this isn't just a microsoft thing. any tool that does phrase alignment hates mismatched lines. try using a diff checker online to compare the files side by side. tools like WinMerge (free!) can highlight invisible differences u might miss.

    aha, and here's a golden nugget, sometimes the issue isn't the content but the line endings. windows (CRLF) vs. linux (LF) can confuse the system. convert both files to the same format using something like VS Code's 'change end of line sequence' option.

    good luck, and let me know if it works! 8-)

    Alex


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.