Contents (7)
- [Blog Introduction] 4-Language Support to Increase Blog Traffic — Routing, Translation, Images, Semantic Search, and Lim
- 1. Showing the Right Language to International Visitors: URL Routing and Language Detection
- 2. Text Translation: Google Translate
- 3. Image & Thumbnail Translation: Utilizing Image Generation LLM
- 4. Multilingual Search: Reusing a Set of Korean Original Texts with Semantic Vector DB
- 5. Limitations and Responses Revealed by Actual Testing
- finish
[Blog Introduction] 4-Language Support to Increase Blog Traffic — Routing, Translation, Images, Semantic Search, and Limitations
This article is AI 70% Human 30% I wrote it as.
I wanted to increase the number of visitors to my blog, which I had been running only in Korean, so I decided to support four languages, including English, Japanese, and Chinese.
To generate actual traffic, we automatically connected foreign visitors to the appropriate language and implemented text translation, text and image translation, and multilingual search .
1. Showing the Right Language to International Visitors: URL Routing and Language Detection

I thought that if I showed the Korean screen as is to visitors who came from overseas via search or links, they would leave immediately.
So, for foreign languages, I separated the URL using the prefixes /en · /ja · /zh-CN , and configured it to redirect directly to the visitor's language on the first visit (utilizing next.js's proxy).
Automatic connection to preferred language : When entering an address without a prefix, it determines the order as follows:
NEXT_LOCALEcookie → browserAccept-Language(qvalue order, Traditional Chinese is alsozh-CN, and if no supported language is availableen), and moves to the corresponding language address307.Remember custom-chosen language : When you change the language using the header language menu or the language link at the top of the post, it is saved in a cookie so that users of a Japanese browser do not revert back to
/jaeven if they click the original Korean text.Search Bot Separation : Googlebot and link preview bots were excluded from redirects to preserve the Korean index.
2. Text Translation: Google Translate

I used Google Cloud Translation, which is free for up to 500,000 characters per month, as the translation engine. Since this is a personal blog, I wanted to avoid being charged for exceeding the free limit, so I recorded the cumulative number of translated characters each month in Redis and set a safety line to ensure that it only runs up to 480,000 characters .
Since there was a set limit, it was important to reduce the number of characters to be transmitted. When I passed the HTML saved by the editor as is, I found that HTML tags, styles, long URLs, and syntax-highlighted code blocks were taking up most of the character count, rather than the actual body text.
All attributes up to
<table>,style, and the longhrefare added to the character count.The entire code block that Shiki split into
<span style="color:...">is chargedDuplicate translation of list preview(
preview) separately from the main text
Structure and attributes are stored in the local DOM : Pure text blocks transmit only plain text (
TEXT) without tags, and long attributes such as<a>and<span>are temporarily replaced withid="a0"and then restored.Protect inline code (
<code>) : Wrap with<span class="notranslate">__CT0__</span>to prevent mistranslations and wasted characters.Code Block (
<pre>) Select Korean only : Skip pure English codes to character count0, extract and translate only comments and string literals from lines mixed with Korean.previewLocal Generation : Generated by extracting only tags from the translated body HTML.
Using this method , we reduced the number of characters transmitted based on the actual text by about 65–70%. We also put the series title and description ( series_translation ) into the same pipeline.
Actually, while developing this feature, I thought that organizing the text structure in JSON format for rendering might be better for translation or other post-processing. JSON makes it easier to cleanly extract the strings needed for translation without having to forcibly remove other tags or perform other operations.
3. Image & Thumbnail Translation: Utilizing Image Generation LLM

There was a problem where Korean text remained intact in body diagrams, screenshots, and thumbnails if only the text was translated. So, I added an image creation/editing LLM (Meta Muse muse-image-1.0 ) to translate images into each language as well. It costs $0.01 per image.
Use
/images/editsAPI to replace only the Korean text in the image with the target language while preserving the original layout, colors, arrows, and code identifiers.The replacement history by language is stored in
image_translation(source_key, lang), and the mapping of the text and thumbnail translation images is maintained even when manually editing and saving the translation.
Images can also be processed through the pipeline, but sometimes Korean text is left untranslated. While having an LLM review these cases could be resolved recursively, I implemented a workflow where I personally verify and continuously make corrections due to cost and quality concerns.
4. Multilingual Search: Reusing a Set of Korean Original Texts with Semantic Vector DB
When I was considering multilingual search, this was the first thought that came to mind.
Since vector databases are semantic databases anyway, wouldn't they be captured in similar vector locations if the meanings are similar, even if the languages are different?
Instead of replicating the vector DB four times for each language, we trusted the Weaviate model ( Snowflake/snowflake-arctic-embed-l-v2.0 ) that supports multilingual cross-embedding and made it so that search terms in four languages can be directly vector searched with only one set of Korean original text indexed .
flowchart TB
Req["Search request (?q=&lang=)"] --> Norm["Unicode normalization"]
Norm --> Branch{"Request language"}
Branch -->|"ko"| KoVec["Weaviate hybrid (α = 0.75)"]
Branch -->|"en / ja / zh-CN"| EnVec["Weaviate pure vector (α = 1.0)"]
KoVec --> KoDB["Korean public post views"]
EnVec --> EnDB["Public Translation Filter · Paging"]
KoDB -.->|"Failure · 0 cases fallback"| PgKo["PostgreSQL pg_trgm"]
EnDB -.->|"Failure · 0 cases fallback"| PgEn["Translation pg_trgm"]4-language integrated natural language search flow
Unicode Search Term Refinement : Fixed an issue where Japanese and Chinese search terms were completely deleted because the existing regular expression only retained Korean and English, by using Unicode character and number standards.
Korean vs. Foreign Language Weight Separation : For Korean, search using a Vector + BM25 hybrid (
alpha = 0.75). For foreign languages, since Korean BM25 is a hindrance, extract candidate post IDs using a pure Vector (alpha = 1.0), then filter down only the publicly available translations in the corresponding language. If there are no results or the Vector search fails, fall back to a PostgreSQLpg_trgmkeyword search.
5. Limitations and Responses Revealed by Actual Testing
After pasting this far and translating actual texts, I clearly saw two limitations where automation alone is not perfect.
Since I only translate comments and string patterns within code blocks to avoid breaking the code syntax, there are often cases where Korean text in some code block comments that cross pattern boundaries remains untranslated .
There are instances where the image generation LLM fails to modify small Korean characters within charts or the text appears broken. I have confirmed that reviewing the modified image with a different LLM and retrying resolves the issue , but there are still cases where the layout or font quality becomes awkward.
Due to the two issues mentioned above, I made it possible to manually edit and replace the translated text and images. If you have the budget, I think you can improve the quality by having them re-translate through an LLM review.
finish
Although there are still areas that need improvement, such as missing code block comments or image translation quality, a sufficient foundation has been established to consistently run a four-language blog within the monthly free limit and test overseas traffic .
I hope that with the addition of this feature, there will be more blog users.
