Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #3052

text-expansion

Skill này làm gì

Skill này kiểm tra CSS có kích thước cố định và cắt cứng làm hỏng văn bản đã dịch hay không. Skill dành cho lập trình viên và nhà thiết kế hỗ trợ nhiều ngôn ngữ.

Khi nào nên dùng

  • ✓Khi một nút hoặc nhãn có chiều rộng cố định sẽ bị vỡ với ngôn ngữ dài hơn.
  • ✓Khi một website sắp được dịch sang nhiều ngôn ngữ.
  • ✓Khi bố cục cắt hoặc ẩn văn bản lấy từ file dịch.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/text-expansion/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/text-expansion/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chúng tôi đang dịch app sang tiếng Đức và các nút bị tràn. Bạn có thể làm bố cục xử lý được văn bản dài hơn không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các chiều rộng cố định và cắt cứng trong phần kiểu dáng. Sau đó agent thay chúng bằng kích thước linh hoạt và gợi ý kiểm thử với một ngôn ngữ giả được kéo dài.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Design UI components to accommodate text expansion from translation

Layouts designed only with English copy routinely break when translated: buttons overflow their containers, labels truncate, and navigation items wrap unexpectedly. Catching these issues early with pseudo-locale testing is far cheaper than fixing them after translations are delivered.

Quick Reference

  • German translations are typically 30% longer than English; Finnish 50% longer
  • Avoid fixed-width containers for text-bearing elements like buttons and labels
  • Use min-inline-size instead of inline-size to allow natural growth
  • Test with a pseudo-locale that inflates strings before committing translations
  • Include pseudolocalization in CI or preview testing, not just manual QA

Check

Identify CSS rules and component styles that use fixed widths or hard truncation on elements containing translatable text, which would break when content expands in other languages. Check that the team can test a pseudolocalized build or preview.

Fix

Replace fixed inline-size with min-inline-size on text containers, remove overflow: hidden from interactive elements, and add a pseudo-locale build step for visual testing in local development and CI.

Explain

Explain how text expansion during translation breaks fixed layouts and what CSS patterns prevent overflow and clipping across locales.

Code Review

Review CSS files and component styles for fixed widths, overflow: hidden, white-space: nowrap, and text-overflow: ellipsis on buttons, labels, navigation items, and headings that contain translatable text.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/i18n/text-expansion

Câu hỏi thường gặp

Văn bản đã dịch có thể dài hơn bao nhiêu?

Skill ghi nhận tiếng Đức thường dài hơn tiếng Anh khoảng 30 phần trăm, và tiếng Phần Lan dài hơn khoảng 50 phần trăm.

Pseudo-localization là gì?

Đó là phiên bản thử nghiệm của site với văn bản giả được làm dài ra, để các vấn đề bố cục lộ ra trước khi có bản dịch thật.

Tôi có nên bỏ overflow hidden ở mọi nơi không?

Skill gợi ý bỏ nó khỏi các phần tử tương tác, vì overflow ẩn có thể cắt mất văn bản.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing CSS for fixed dimensions, truncation, or overflow rules on elements that render translatable strings.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3052
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự