套件概覽
一個平台無關的 Dart 庫,用於解析和編譯 gettext .po 和 .mo 檔案,可在 Flutter 及其他 Dart 應用中實現強大的本地化與國際化功能。它支援讀取翻譯目錄、提取訊息,以及產生編譯後的二進位 .mo 檔案。此套件非常適合在 Android、iOS、Linux、macOS、Web 與 Windows 平台之間管理多語言內容的開發者。依賴項目極少,API 簡單直覺,能順暢整合至現有工作流程。對於需要精確控制翻譯檔案處理而不依賴外部工具的專案尤為實用。
適用情境
- 解析 .po 檔案以提取翻譯
- 將 .po 檔案編譯為 .mo 二進位檔
- 與 Flutter 應用整合以支援多語言
- 在CI/CD流水線中管理翻譯
- 支援桌面和網頁本地化
主要特色
- Supports both .po and .mo file formats
- Cross-platform compatibility
- Simple API for parsing and compiling
- No external dependencies
- Efficient message extraction and encoding
適合對象
- Flutter developers needing i18n
- Teams using gettext for translations
- Projects targeting multiple platforms
- Build automation involving translation files
- Developers avoiding runtime translation libraries
使用建議
- 需要手動處理翻譯加載
- 不是完整的國際化框架
- 僅限檔案解析/編譯
- 無內建的備用或地區設定切換
- 最佳搭配自訂 i18n 層使用