MDX files¶
Added in version 2026.5.
注釈
この形式への対応は開発中です。一部の機能はまだ使用できないません。動作はリリース間で変更することがあります。テスト結果のフィードバックは歓迎します。
MDX files are Markdown files with JSX syntax. Weblate extracts translatable Markdown text and preserves imports, exports, JSX components, and expressions.
MDX units automatically get the md-text and auto-safe-html flags.
This keeps the unsafe HTML check active for plain text, standard HTML, and
custom elements while avoiding HTML cleanup on MDX and JSX-like syntax.
Use the explicit safe-html flag for strings that are known to contain HTML
and should always be sanitized, including SVG or MathML snippets.
注釈
他の多くのフォーマットとは異なり、翻訳ファイルの変更は確実に Weblate にインポートされない点に注意してください。翻訳の正確な情報源は翻訳ファイルではなく Weblate です。
参考
ファイルの例:
---
title: Ahoj světe!
description: Learn with Weblate
---
import LessonCard from "./LessonCard"
export const metadata = { slug: "intro" }
# Ahoj světe!
<LessonCard title="Keep this code" count={5}>
Do not translate this JSX body.
</LessonCard>
Orangutan has five bananas.
Try Weblate at [weblate.org](https://demo.weblate.org/)!
*Thank you for using Weblate.*
File extensions |
|
|---|---|
Linguality ⓘ |
Monolingual |
Supports plural ⓘ |
|
Supports descriptions ⓘ |
|
Supports explanation ⓘ |
|
Supports context ⓘ |
|
Supports location ⓘ |
|
Supports flags ⓘ |
|
API identifier |
|
Supports read-only strings ⓘ |
|
Check flags added by this format ⓘ |
|
Weblate の設定¶
典型的な Weblate コンポーネント構成 |
|
|---|---|
ファイル マスク |
|
モノリンガル用の、基礎となる言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
MDX file |
ファイル形式パラメータ |
|
重複文字列の処理¶
By default, Weblate treats each occurrence of a string as a separate translation unit to provide line-based context. This can be problematic in MDX tables or repeated component content, where reordering changes the context and can lead to translation loss.
同一の文字列を 1 つの翻訳単位に統合するには、ファイル形式パラメータ で Deduplicate identical strings を有効にしてください。
注釈
このオプションを有効にすると、統合された翻訳単位に対する行ベースのコンテキストが無効になり、ドキュメント内で行やセクションが移動された場合でも翻訳が安定して保持されます。