ホーム / Skills / Web・UIデザイン / UI の国際化対応(UI Internationalization)
Web・UIデザイン

UI の国際化対応(UI Internationalization)

AIBarsMITSkill の言語: 英語
ライセンス確認済みスクリプトなし低リスク
デモ実行記録 · claude-sonnet-5-5 · 2026年10月
Using the ui-internationalization skill, review and plan the work to add German, Japanese and Arabic to an English-only React dashboard. Facts: strings are inline in components; dates are formatted as MM/DD/YYYY by hand; buttons and tabs have fixed pixel widths; the CSS uses margin-left and text-align:left; plurals are done with count === 1; there is no language switcher.
Skill: ui-internationalization

I haven't opened the code, so this review is based only on the facts you gave. I can't cite files or line numbers yet, and step 1 of the plan is a code audit to find them.

Assumptions to confirm

  • Languages: German (de), Japanese (ja) and Arabic (ar), plus English. Arabic means RTL has to be built in from the start.
  • Arabic region: The choice affects the calendar, numerals and currency. For example, ar-SA defaults to the Islamic calendar, while ar-EG and ar-AE use Gregorian. I recommend ar-AE or ar-EG with Latin digits unless the product team says otherwise.
  • Currency and time zone: These should stay independent of language.
  • Translations: I'm assuming they come from people or a vendor, so the catalog needs translator context.
  • Charts: I don't know if the dashboard has charts, and I'd check. Axes, legends and tooltips would need RTL handling too.

Review findings

Hard-coded text

  • Inline strings in components. Every label, placeholder, tooltip, aria-label, error message and page title needs a catalog key. Fix: adopt a library (react-intl or i18next with ICU), use stable keys, and add a translator description for each key.
  • count === 1 plurals. This is wrong for Arabic, which has six plural categories (zero, one, two, few, many, other). It is also wrong for Japanese, which has only "other". Fix: use ICU {count, plural, ...} messages. Arabic needs all six forms written out.
  • Likely string concatenation. Inline strings usually come with count + " items in " + name patterns. Fix: whole messages with named placeholders. I'd grep for + " and template literals in JSX.
  • Ambiguous one-word labels. Words like "Open" or "Filter" can be a verb or a noun. Fix: separate keys per meaning.

Formatting

  • Hand-written MM/DD/YYYY. This is wrong for all three new languages. Fix: Intl.DateTimeFormat(locale, options), with dates stored as ISO or timestamps. Check whether the data layer holds already-formatted strings.
  • Numbers, currency, percentages. These are probably formatted by hand too. Fix: use Intl.NumberFormat, with currency as an explicit code and not derived from the language.
  • Other formatters. Relative time ("3 days ago"), lists, and sorting should use Intl.RelativeTimeFormat, Intl.ListFormat and Intl.Collator.
  • Language and region. Keep these as separate settings.

Layout and truncation

  • Fixed pixel widths on buttons and tabs. German will overflow them and clip. Fix: remove the widths and use min-width, padding and flex or grid with gap. Where truncation is unavoidable, use an ellipsis plus a tooltip or accessible name.
  • Fixed heights. Check for these as well, since text will wrap to more lines.
  • Verification. Use pseudo-localization (about 40% longer, accented, in brackets) to find every clipped element before real translations exist.

Scripts and fonts

  • No lang on the document. Set <html lang> per locale. This is needed for Japanese glyph selection, since the Han characters render differently under ja.
  • Font stack. Add Japanese and Arabic fallbacks; a Latin-only stack will give inconsistent system fallbacks. Check that the bold weights exist for those scripts.
  • Typography.
    • Give Japanese more line-height.
    • Remove any italic emphasis, any forced uppercase, and any letter-spacing on Arabic. Letter spacing breaks Arabic joining.
    • Don't truncate strings by character index; use Intl.Segmenter if any code does.

RTL

  • margin-left and text-align: left. These will break the Arabic layout. Fix: switch to margin-inline-start, padding-inline, text-align: start, inset-inline-* and border-inline-*. Do this by codebase-wide search and replace, then review each hit. Also check for float, left: / right:, and translateX.
  • dir. Set dir="rtl" on the root for Arabic.
  • Icons. Audit them one by one. Mirror chevrons, back and next arrows, and progress bars. Don't mirror logos, play/pause icons, clocks or numerals.
  • Mixed-direction content. Wrap user-generated or unknown-direction text in <bdi>. Give email, URL and code fields dir="ltr".
  • Charts. If there are any, decide deliberately whether to mirror the time axis. Numerals and axis values stay LTR.

Routing and switching

  • No language switcher. Add one labeled in each language's own name (English, Deutsch, 日本語, العربية), with no flags.
  • Locale order. Use saved choice, then URL, then browser Accept-Language, then default. Don't force a redirect.
  • Persistence. Remember the choice.
  • URLs and SEO. If the dashboard is public, use a path prefix per language with hreflang, x-default and canonical URLs. If it's behind a login, a saved preference may be enough, but I'd confirm.
  • Fallback. Missing translations fall back to English and log the gap. Raw keys should never show.

Plan

  1. Audit (about 1–2 days). Grep for hard-coded strings, count ===, manual date code, width: in px, and left/right/margin-left. This gives a real inventory and effort estimate. Confirm the Arabic region and numeral choice, the translation source, and whether the app has charts or is public.
  2. Foundation.
    • Pick the i18n library and set up the message catalog, with the en catalog as the source.
    • Add a locale provider, a lang/dir setter and the switcher.
    • Add the font stacks and a pseudo-locale.
    • Add a lint rule against literal JSX text (e.g. eslint-plugin-i18next).
  3. Layout and CSS (can run in parallel with step 4). Remove fixed widths and convert to logical properties. Make buttons and tabs flexible, and audit icons for mirroring. Verify with the pseudo-locale and with Arabic under dir="rtl".
  4. Extract strings. Move them component by component into the catalog, with translator notes and ICU plurals. Replace concatenation with whole messages.
  5. Formatting layer. Make one helper module wrapping Intl.* for dates, numbers, currency, lists and relative time. Replace every manual format and store dates as ISO or timestamps.
  6. Translation. Send the catalog to translators with context, including the six Arabic plural forms. Flag legal text, examples and region-specific content for review.
  7. QA and verification. Run every screen in en, de, ja, ar at phone and desktop widths. Test plurals with counts of 0, 1, 2, 5 and a large number (Arabic needs 0, 1, 2, 3–10, 11–99 and 100+ to cover all forms). Compare dates and numbers across two regions. Check lang and dir in the DOM. Search again for leftover hard-coded strings.

Order and risk: the CSS conversion (step 3) and string extraction (step 4) are the largest pieces of work. RTL is the riskiest because it touches every component, so do it early and not at the end.

Not checked: I haven't looked at the codebase, run anything, or tested any real RTL or translated text. All of the above comes from the facts you listed.

If you'd like, I can start with step 1 once you point me at the project directory. The working directory appears to be empty.

Real run in an isolated folder with only this skill installed. Only the Skill and Read tools were enabled, so no command was run and no file was written. The scenario is fictional and the model had no access to the code. The model proposed a plan and listed what it could not check.

できること

国際化(UI がローカライズできる状態)とローカライズ(翻訳そのもの)を分け、前者を扱います。6 つのルールがあります。画面に見える文字をコードに書かない(名前つきプレースホルダーを持つ完全なメッセージを使い、断片をつなげず、複数形は count === 1 ではなく標準の仕組みで)。日付、数値、通貨、リスト、相対時間は、ロケール対応の Intl API で整形する。論理 CSS プロパティと擬似ローカライズで、長さの違う文字でも崩れないレイアウトにする。文字体系、フォント、改行を扱う(lang、zh-Hans と zh-Hant、フォントのフォールバック、CJK の挙動)。右から左のレイアウトに対応する(dir、反転すべきものとすべきでないもの、双方向テキストの分離)。言語切替、ロケールの決定順、URL、hreflang、フォールバックを設計する。

ほかに扱うこと

言語、地域、通貨、タイムゾーンを互いに独立させる、日付をタイムスタンプで保存する、柔軟な氏名・住所フォーム、メッセージキーへの翻訳者向け文脈、完了とする前の確認リスト。

向いている場面

2 つ目の言語の追加、英語のみの製品へのドイツ語・日本語・アラビア語の追加、「翻訳すると崩れる」UI の見直し。

補足とリスク

低リスク:スクリプトのない指示のみのパッケージで、ネットワーク接続やファイル書き込みはありません。翻訳は行わず、翻訳の質も評価しません。機械翻訳や未確認の翻訳は、その言語に堪能な人の確認が必要で、法務・医療・地域固有の内容は現地での確認が必要です。お使いのコードは見られず実行もできないため、実際の右から左の描画など、確認していない点を挙げます。一部の `Intl` の機能は、対象ブラウザでの対応状況を確認してください。AIBars 制作のオリジナル(MIT)。架空の React ダッシュボードで 1 回試用しました。