Skip to content

Update translations and internationalization files#44

Open
gamesushi wants to merge 1 commit into
pH7Software:mainfrom
gamesushi:main
Open

Update translations and internationalization files#44
gamesushi wants to merge 1 commit into
pH7Software:mainfrom
gamesushi:main

Conversation

@gamesushi

Copy link
Copy Markdown

Summary

This PR adds full translation support for Simplified Chinese (zh_CN) and Hebrew (he_IL), fixes several i18n bugs, and includes Windows/PHP 8.2 compatibility patches for the gettext emulation layer.

New Language Packs

zh_CN (Simplified Chinese)

  • Complete language pack: language.php (360+ entries), config.ini, global.po with 99%+ translation (2,443 entries)
  • Route config (zh.xml) added

he_IL (Hebrew) — 97% translated (2,146 entries)

  • Note: Google Translate uses language code iw for Hebrew, not he

Bug Fixes

it_IT 500 Error (Critical)

  • it_IT/language.php and pt_BR/config/config.ini had UTF-8 BOM headers (EF BB BF), causing PHP 8.2 fatal error: "Namespace declaration statement has to be the very first statement"
  • Removed BOM and normalized line endings to LF

pt_BR Language Name

  • Fixed config.ini name from EnglishPortuguês (Brasil)

he_IL Text Direction

  • Fixed config.ini dir from rtfrtl (Hebrew is right-to-left)

Windows gettext Emulation Patch (gettext.inc.php)

  • _setlocale(): Added fallback to getenv('LC_ALL') when $CURRENTLOCALE is empty (Windows setlocale with POSIX locale names returns false)
  • _encode(): Empty charset now defaults to UTF-8 instead of throwing ValueError in mb_convert_encoding on PHP 8.2

Translation Tools

Tool Purpose
batch_translate_fast.py Multi-threaded Google Translate batch translator (5 workers, placeholder-safe)
compile_mo.py Compile all .po.mo via polib
fix_translations.py Post-translation fix for common mistranslations (e.g. Save→节省→保存)
lang_diag.php Browser diagnostic page for all 12 languages

Testing

  • All 12 languages verified functional on XAMPP/Windows + PHP 8.2
  • _tools/lang_diag.php passes for all locales
  • http://ph7builder.local:8081/?l=zh_CN → Chinese
  • http://ph7builder.local:8081/?l=he_IL → Hebrew (RTL)
  • http://ph7builder.local:8081/?l=it_IT → Italian (no longer 500)

@gamesushi

Copy link
Copy Markdown
Author

add Chinese fix Italian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants