BookTranslator
BookTranslator

Nxaniso lowu a wu kumeki hi ririmi ra wena sweswi, hikwalaho wu kombisiwa hi Xinghezi.

How to Translate a CBZ or CBR Comic Archive Without Scrambling Page Order

Fix page order, covers, junk files and right-to-left settings before you translate a CBZ or CBR comic. Includes a free archive checker and a sample file.

BookTranslator

BookTranslator Team

11 wa timinete to hlaya

A CBZ file is a ZIP archive of page images, and a CBR file is the same idea packed with RAR. Nothing inside the archive says "this is page 2". Comic readers, and translation tools, work out the page order by sorting the file names. So most problems with a translated comic start before the translation. A cover lands at the back, page 10 shows up after page 1, or a right-to-left manga opens left-to-right.

Run three checks before you upload. Make sure the page names sort into the right order, remove anything that is not a page, and keep the ComicInfo.xml file if the archive has one. Then upload the archive as a CBZ. We wrote a free comic archive checker that runs all three checks in a second and can repack the file with safe page names.

Quick Answer: What to Do With Your Archive

What you haveWhat to do before uploading
A .cbz whose pages are named 001.jpg, 002.jpg …Upload it as it is
A .cbz with pages named 1.jpg … 10.jpg, or an unnumbered cover.jpgRepack it with zero-padded names (Step 2)
A .cbr, .cb7 or .cbt fileExtract it, then repack the folder as a .cbz (Step 3)
Pages saved as AVIF, JPEG XL or HEICConvert those pages to PNG, JPEG or WebP first
A manga that should read right to leftKeep its ComicInfo.xml, and update the language field after translation
A comic bought from a store appCheck that you actually have a DRM-free file you are allowed to use

The sections below explain each row.

Why Page Order Breaks: Readers Sort File Names

There are two common ways to sort file names, and they disagree as soon as page numbers have different lengths:

  • A plain character sort compares names one character at a time. 10.jpg starts with 1, so it comes before 2.jpg. You get the order 1, 10, 11, 12, 2, 3 …
  • A natural sort reads a run of digits as a number, so 2 comes before 10. You get 1, 2, 3 … 10, 11, 12.

Many comic readers sort naturally, but you can't count on it, and you can't control which reader the translated file will be opened in. The fix that works everywhere is to zero-pad the numbers: 001.jpg … 010.jpg sort the same way with either method.

Two other naming problems are easy to miss:

  • An unnumbered cover sorts last. Both sorting methods put digits before letters. In an archive with cover.jpg and 001.jpg … 024.jpg, the cover becomes the final page.
  • Chapter folders sort as part of the name. Chapter 10/01.jpg and Chapter 2/01.jpg compare the folder names first, so the folder numbers need the same care as the page numbers.

BookTranslator orders .cbz pages with a natural, case-insensitive sort and skips junk entries such as __MACOSX folders, dotfiles like .DS_Store, and Thumbs.db. This means page 2 comes before page 10 while the file is being translated. The translated pages keep their original names, though. If you upload 1.jpg … 12.jpg, you get back 1.png … 12.png, and a reader that uses a plain sort will still mix them up. Renaming before you upload fixes the order for every reader.

Step 1: Check the Archive

Download check_comic_archive.py and run it on your comic. It needs Python 3.8 or newer and nothing else, and it does not upload anything:

python3 check_comic_archive.py "My Comic.cbz"

To show what it finds, we built a small sample archive with problems we often see in comic files. It has twelve pages numbered without zero-padding, an unnumbered cover.png, one double-page spread, an AVIF file, macOS junk entries, and a ComicInfo.xml marked as right-to-left manga. The README explains how to rebuild it with make_test_comic.py. Here is the end of the report:

Junk entries (skipped): .DS_Store, __MACOSX/._1.png
Other files (carried over unchanged): ComicInfo.xml
ComicInfo.xml:
  Manga (reading direction): YesAndRightToLeft
  Right-to-left is stored here, not in the images. Keep this file in the archive so readers that honor it still see it.
  LanguageISO: ja. Update it after translation; a copied ComicInfo.xml still names the source language.
  Page table: 13 entries for 13 page images.
  13 entries record ImageSize/ImageWidth. These describe the original files and no longer match once pages are replaced.

Check before uploading:
  - A plain character sort puts '10.png' at position 2, where natural sort has '2.png'. A reader without natural sorting will show pages out of order.
  - Pages without a number in the file name: 'cover.png' at 13. Digits sort before letters, so an unnumbered cover usually ends up last.
  - Page numbers use [1, 2] digits. Zero-pad them (001, 002, ... 010) so every reader agrees on the order.
  - Images in a format that is not treated as a page here: 13.avif. Convert them to PNG, JPEG or WebP, or they stay untranslated.

Above that, the report lists every page in reading order with its size. It flags a page that is wider than it is tall as a two-page spread, and a page more than three times taller than it is wide as a tall strip, like a webtoon chapter. Those are the pages to look at first when the translation comes back.

For plain ASCII file names, the checker's natural sort follows the same comparison BookTranslator uses for .cbz pages, including chapter folders, mixed case, spaces, hyphens and underscores. Names with accented letters or Japanese kana can sort differently between tools, which is one more reason to rename pages to plain zero-padded numbers.

Step 2: Repack With Safe Page Names

If the report lists ordering problems, look at the printed order first, then repack:

python3 check_comic_archive.py "My Comic.cbz" --first cover.png --repack "My Comic fixed.cbz"

--repack writes a new CBZ. The pages are renamed 0001, 0002 … in the order shown, junk entries are dropped, and every other file, including ComicInfo.xml, is copied unchanged. --first moves a page to the front, which is how you put an unnumbered cover back where it belongs. You can repeat it for a second page, such as a title page. The renaming locks the order in, so fix it before you repack, not after. If the archive has a ComicInfo.xml page table, moving pages shifts their positions; the checker reminds you to check entries such as the front-cover marker afterwards.

On the sample archive, the repacked file has pages 0001.png … 0013.png with the cover first and no junk entries. The only warning left is the AVIF file. The checker can't convert images; open that page in an image editor and export it as PNG, JPEG or WebP. Formats like AVIF, JPEG XL and HEIC are not treated as pages. They are copied into the result as they are, untranslated.

Step 3: Turn a CBR, CB7 or CBT File Into a CBZ

A .cbr file is a RAR archive, a .cb7 is 7z, and a .cbt is tar. Renaming a .cbr to .cbz does not convert it. The checker reads the first bytes of the file. For a RAR, 7z or tar archive it stops and tells you which one you have. If it prints a normal page report instead, the file is already a ZIP archive under another name: rename it to .cbz and go back to Step 1.

To convert a real RAR, 7z or tar archive, extract it into a folder with 7-Zip or The Unarchiver. Then point the checker at that folder:

7z x "My Comic.cbr" -o"My Comic"
python3 check_comic_archive.py "My Comic" --repack "My Comic.cbz"

The repack puts the pages and ComicInfo.xml at the top level of the new archive, even if the extracted files sat in a subfolder.

BookTranslator accepts CBR, CB7 and CBT uploads as well, but they go through a different pipeline at a flat price, and the page-by-page process described in the next section applies to .cbz files. Converting first is a few seconds of work and gives you the clean page names from Step 2 too.

Step 4: Keep ComicInfo.xml, Then Update It

Many archives include a ComicInfo.xml file with the title, series, language and reading direction. Its format is maintained by the Anansi Project. Two of its fields matter here:

  • Manga. The schema allows Unknown, No, Yes and YesAndRightToLeft. The last one is how an archive tells a reader to turn pages right to left. The page images can't carry that setting, so if the file is lost, readers that use it lose the reading direction too.
  • LanguageISO. This holds the comic's language code. After translation it still names the source language, for example ja, until you change it.

BookTranslator copies ComicInfo.xml into the translated archive unchanged, so right-to-left manga stays right-to-left in readers that support the flag. Open the file in a text editor afterwards and change LanguageISO to the target language. If the file has a <Pages> table, its entries point to pages by position, so they still match as long as you did not reorder pages. Size values such as ImageSize describe the original images and will no longer match the translated PNG pages. A library tool that relies on them may need to rescan the file.

What BookTranslator Does With a CBZ

When you upload a .cbz comic, BookTranslator:

  1. lists the page images (PNG, JPEG, WebP, GIF, BMP or TIFF) in natural order and skips junk entries;
  2. runs each page through the same pipeline used for single images. It finds the text, removes the original lettering, and draws the translation in its place, working on a few pages at a time;
  3. builds a new .cbz with each translated page saved as a PNG in the same position, plus every other file from the original archive.

Some details are worth knowing before you pay:

  • The price depends on the page count. Every page is a full image-translation run, so a CBZ is priced per page rather than per word. The quote appears after upload, before checkout. Removing junk entries and stray non-page images does not change it, because those are not counted as pages.
  • A failed page keeps its original image. If a single page fails, it stays in the source language and in the right position, so the comic is still complete. If more than 30% of the pages fail, the task fails instead of delivering a mostly untranslated book.
  • You get the translated comic only. Comic archives have no bilingual side-by-side version.
  • Pages come back as PNG. The translated archive can be noticeably larger than a JPEG original.

If you also need the Japanese text itself, for example from scanned manga volumes with vertical columns and furigana, our guide to Japanese vertical text OCR covers those reading-order problems for text pages.

Before You Upload: File Access

This guide assumes the comic is a file you own and can open freely, such as a DRM-free purchase, your own scans, or your own work. Store apps often deliver comics in protected formats that only open inside their own reader. Renaming or repacking those files does not change that. If you are not sure, read how to check an ebook for DRM before translation first. Downloading a file also does not give you permission to share or publish a translation of it.

Translate the Comic

Once the checker reports no ordering problems and every page is PNG, JPEG or WebP, upload the CBZ to the manga translator and check the page-count price before you pay. When the translation is ready, open it in the reader you plan to use. Look at the cover, the first double-page spread and the last page, then fix LanguageISO in ComicInfo.xml. For longer projects, such as a series you plan to publish, our complete guide to book translation covers review, terminology and consistency across volumes.

Matsalwa lama fambelanaka

How to Translate a CBZ or CBR Comic Archive Without Scrambling Page Order