Оваа статија сè уште не е достапна на вашиот јазик, па затоа е прикажана на англиски.
How to Translate a CSV File Without Shifting Columns or Breaking Quotes
See which CSV cells a file translator sends (codes, URLs, and formula text included), why the header row, delimiter, and encoding change, and how to split, translate, merge, and check a CSV with a free script.

To translate a CSV file, upload the file to a translator that reads CSV, rather than pasting its text into a chat window or a web translator. A CSV-aware translator splits the file into cells, translates the text in each cell, and writes the cells back in the same rows and columns. Pasted text is just characters: one changed quote mark or one comma added inside a sentence, and every cell after it moves one column to the right.
Reading the file correctly solves the quoting problem. It does not decide which columns should be translated. A product catalog has names and descriptions that need translating, next to SKUs, URLs, and language codes that must not change. Most CSV translators treat the column as the unit, so a code column with letters in it gets sent along with the prose.
We built a test catalog with every one of those cases in it and wrote a free checker that inspects a CSV, makes a translation copy, merges the result back, and compares the shapes. We also ran the test file through BookTranslator's CSV parsing and writing code, the code running in production on 2026-11-27, with a marker in place of a model, so you can see exactly which cells are sent and how the file comes back.
Quick Answer: What Happens to Each Part of a CSV
| Part of the file | Example from our test | What BookTranslator does | What to do |
|---|---|---|---|
| Header row | sku,name,description | Kept as it is, never translated | Translate column names by hand if you need to |
| Text cells | "Reading lamp, brass" | Translated | Nothing |
| Cells with a comma, quote, or line break | "Leather, ""hand-stitched""" | Read and written back correctly quoted | Nothing |
| Cells with only digits, symbols, or spaces | 3301, 12.50, 19,99 | Not sent | Nothing |
| Codes with letters | BK-102 | Sent, because the column has text in it | Leave the column out of the upload (Step 2) |
| URLs and email addresses | https://example.shop/p/bk-102 | Sent | Leave the column out |
| Language or country codes | en | Sent | Leave the column out |
| Text that looks like a formula | =C2*2 | Sent as text | Leave the column out |
| Empty cells | (blank description) | Stay empty | Nothing |
| Blank lines between rows | an empty line | Removed | Nothing, unless a line number matters to you |
| Delimiter | semicolons | Written back as commas | Re-save with semicolons if your system needs them |
| Encoding | UTF-8 with or without a byte order mark | Written back as UTF-8 without a byte order mark | See the encoding section |
The rest of this guide shows where each row comes from. The short version: translate a copy that holds only the columns with words in them, plus a row number, then merge it back.
Step 1: Inspect the File Before You Upload
Run the checker on the file you plan to translate. It needs Python 3.9 or later and nothing else:
python3 csv_check.py inspect sample-catalog.csv
On our test catalog it printed:
File: sample-catalog.csv
Encoding: UTF-8
Delimiter: comma
Rows: 1 header + 3 data rows, 1 blank line(s)
Line breaks inside cells: 1 (keep them quoted; do not paste this file into a text box)
Columns (the header row itself is shown, not judged):
1. 'sku' text -> code (2/3, e.g. 'BK-102')
2. 'name' text
3. 'description' text
4. 'price' digits only
5. 'product_url' text -> url (3/3, e.g. 'https://example.shop/p/bk-102')
6. 'lang' text -> language code (3/3, e.g. 'en')
7. 'notes' text -> formula (1/2, e.g. '=C2*2')
Read it from the bottom up. price is digits only, so no translator that skips numbers will touch it. name and description are the text you want translated. The four flagged columns are the problem: each has letters in it, so a CSV translator treats it as text, and each holds a value that must come back exactly as it went in.
The checker also tells you three things a translator will not:
- Which delimiter it found. Our second sample, a French export, uses semicolons. Excel saves a CSV with the computer's list separator, which is a comma by default and can be changed in the Windows region settings (Microsoft Support). The same page notes that when the decimal separator is a comma, Excel uses a semicolon to separate the fields instead.
- Whether the file is UTF-8. The French sample is Windows-1252, the older encoding many spreadsheet exports still use. The checker reads it, but tells you to re-save it as UTF-8 first.
- Line breaks inside cells. A description with two lines is legal CSV as long as the cell is in double quotes (RFC 4180, section 2). A file reader keeps it; a text box usually does not.
Step 2: Make a Translation Copy With Only the Text Columns
Here is what we found in BookTranslator's CSV code, and it is the reason for this step. For each column, the code looks at every data row. If any cell in that column contains a letter, the whole column is treated as text, and every cell in it that has a letter is sent for translation. A cell with only digits, punctuation, and spaces is never sent, even in a text column.
So in our test, the code selected BK-102 and BK-207 for translation and skipped 3301. It selected the URLs, the en codes, and =C2*2 too. A model will often return a product code unchanged, but nothing in the file format protects it, and a single changed SKU or URL is enough to break an import. The tool does not let you choose columns, so you choose them before the upload:
python3 csv_check.py split sample-catalog.csv --translate name,description
Wrote sample-catalog.to-translate.csv: row_id + ['name', 'description'], 3 rows, UTF-8 with a byte order mark. Translate this file.
The copy has three columns:
row_id,name,description
1,"Reading lamp, brass","Warm light.
Clips to any shelf."
2,Bookmark,"Leather, ""hand-stitched"""
3,Book stand,
The row_id column holds only digits, so it is never sent and comes back exactly as it went in. That makes it a safe key for putting the translation back. Do not use the SKU as the key: it has letters, so it would be sent with everything else.
Two more details from the code matter here:
- The first row is never translated. It is treated as the header. If your file has no header row, add one, or the first product will come back in the original language.
- Blank lines are dropped. The translated file has no empty rows. That is harmless unless something downstream counts lines.
If you would rather not run a script, do the same thing in a spreadsheet: insert a column of row numbers, copy it with the text columns into a new sheet, and save that sheet as the file you translate.
Step 3: Translate the Copy
Upload sample-catalog.to-translate.csv to the document translator and choose the target language. You see the price before you pay.
When the task finishes, there are two files to download. The translated file has the same columns with the text replaced. The bilingual file (Download bilingual, in History) adds a column after each translated one, named after it with _translated on the end:
row_id,name,name_translated,description,description_translated
The bilingual file is the easier one to review: the source and the translation sit next to each other in one row. In our full-catalog run, a cell that was not sent, such as the digits-only 3301, left its _translated cell empty rather than copying the value across. You can see both outputs from that run in sample-output.csv and sample-output-bilingual.csv. They contain markers, not translations.
If the same product names appear across many rows, or a brand name must stay in English, set up a glossary first. Our guide to what not to translate covers names, codes, and units in more detail.
Step 4: Check the Result and Merge It Back
The download is named after your file, with a note in the target language added, such as (traduit par booktranslator.app) for French. Rename it, or use that name in the commands below; we call it sample-catalog.to-translate.translated.csv.
Compare the translated copy with the copy you uploaded. --keep names columns that must not change:
python3 csv_check.py compare sample-catalog.to-translate.csv sample-catalog.to-translate.translated.csv --keep row_id
Note: byte order mark removed
OK: same shape
The note is expected (see the next section). The check confirms the header, the number of rows and columns, and every row_id are the same, and that no empty cell gained text and no text cell went empty. It also lists text cells that came back identical to the source. That is normal for a brand name and worth a look for a sentence.
Then put the translated columns back into the original:
python3 csv_check.py merge sample-catalog.csv sample-catalog.to-translate.translated.csv
Wrote sample-catalog.merged.csv with comma delimiter, encoding utf-8.
The merged file uses the delimiter of the original, so a semicolon file stays a semicolon file. It is written as UTF-8, with a byte order mark if the original had one or was in an older encoding such as Windows-1252, because a translation can contain characters an older encoding cannot store. Run the compare once more against the original, keeping every column that should be untouched:
python3 csv_check.py compare sample-catalog.csv sample-catalog.merged.csv --keep sku,price,product_url,lang,notes
In our run it printed OK: same shape. For contrast, here is the same compare run against the file our run of BookTranslator's CSV code produced for the whole, unsplit catalog:
PROBLEM: Row 2, sku: 'BK-102' changed to 'ES[BK-102]'
PROBLEM: Row 2, product_url: 'https://example.shop/p/bk-102' changed to 'ES[https://example.shop/p/bk-102]'
PROBLEM: Row 2, lang: 'en' changed to 'ES[en]'
PROBLEM: Row 2, notes: '=C2*2' changed to 'ES[=C2*2]'
...
10 problem(s)
Every one of those ten cells would be sent to the translator. With a real model, some would come back unchanged and some would not, and you would not know which without checking.
Encoding: Add a Byte Order Mark Before You Upload
A CSV file does not say which encoding it uses, so a translator has to guess. BookTranslator's code detects it from the bytes. On our French copy, a short UTF-8 file without a byte order mark, the detector guessed ISO-8859-1 instead, and the accents came back garbled before any translation happened: "Lumière" became "Lumière". The same file with a byte order mark (the three bytes EF BB BF at the start) was read as UTF-8 and came back clean.
That is why the split command writes its copy with a byte order mark, and why inspect flags a UTF-8 file that has accented characters and no mark. If you prepare the copy another way, save it as UTF-8 with a byte order mark, so the encoding is not left to a guess.
The translated file comes back as UTF-8 without a byte order mark. Microsoft says Excel opens a UTF-8 CSV normally when it has the mark, and otherwise lists importing it with Data > Get Data > From Text/CSV as a way to open it (Microsoft Support). If you double-click the translated file and see garbled accents, the file is fine: import it that way instead, or use the merged file, which has the mark whenever your original had one.
Delimiters, TSV Files, and When to Use XLSX Instead
The translated CSV always uses commas. Our semicolon sample came back comma-separated, with decimal commas such as "12,50" kept inside quotes, so the numbers did not split into two columns. The file is valid, but a shop or a database set up for semicolons will reject it. Either merge it back with the script, which restores the original delimiter, or re-save it with semicolons.
A .tsv file goes through the same code with tabs instead of commas, and it comes back with tabs.
If your data lives in a workbook with formulas, dropdowns, or several sheets, translate the .xlsx instead. Exporting to CSV throws all of that away. Our Excel translation guide covers what happens to each part of a workbook. For app strings stored as key-value files, the JSON language file guide is the better fit.
Common Problems
The columns shifted after translation. The file was probably translated as plain text, or edited and saved by a tool that changed the quoting. Run compare against the original: it reports the first row whose column count changed. Then translate the file again as a file, not as pasted text.
My SKUs or URLs were changed. The column had letters in it, so it was sent. Split the file so that only text columns are uploaded, and merge by row_id.
The first product was not translated. The first row is always treated as the header. Add a header row and translate again.
Accents are garbled in the translated file. If they are garbled in a text editor too, the source was read in the wrong encoding: save it as UTF-8 with a byte order mark and translate it again. If they look fine in a text editor and wrong only in Excel, import the file through Data > Get Data > From Text/CSV.
Can I translate only the new rows? Not inside one upload: every text cell in the file is sent. Put the new rows in their own file, translate it, and merge the result.
Should I translate the header? Only if people read it. If the file is imported by software, the column names are part of the import format, which is why they are left alone.
Поврзани објави





