schon/scripts/Windows/make-messages.ps1
Egor fureunoir Gorbunov e49c942a1b Features: 1) Add detailed in-line comments with type ignore for improved debugging and maintainability; 2) Update I18N strings and translation placeholders across locales; 3) Introduce "address set" as a translatable object;
Fixes: 1) Resolve malformed phone number error message format; 2) Fix minor grammatical issues in message strings; 3) Align POT-Creation-Date metadata in locale files;

Extra: Enhance formatting consistency in documentation and translations; Remove obsolete translation strings.
2025-07-14 16:22:19 +03:00

44 lines
1.7 KiB
PowerShell

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
.\scripts\Windows\starter.ps1
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (-not (Test-Path '.env'))
{
Write-Warning ".env file not found. Exiting without running Docker steps."
exit 0
}
Write-Host "Remove old fuzzy entries..." -ForegroundColor Magenta
docker compose exec app poetry run python manage.py fix_fuzzy
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "Old fuzzy entries removed successfully!" -ForegroundColor Green
Write-Host "Updating PO files..." -ForegroundColor Magenta
docker compose exec app poetry run python manage.py makemessages -l en_GB -l ar_AR -l cs_CZ -l da_DK -l de_DE -l en_US -l es_ES -l fr_FR -l hi_IN -l it_IT -l ja_JP -l kk_KZ -l nl_NL -l pl_PL -l pt_BR -l ro_RO -l ru_RU -l zh_Hans
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "PO files updated successfully!" -ForegroundColor Green
Write-Host "Fixing new fuzzy entries..." -ForegroundColor Magenta
docker compose exec app poetry run python manage.py fix_fuzzy
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "New fuzzy entries fixed successfully!" -ForegroundColor Green
Write-Host "Translating with DeepL..." -ForegroundColor Magenta
docker compose exec app poetry run python manage.py deepl_translate -l en-gb -l ar-ar -l cs-cz -l da-dk -l de-de -l en-us -l es-es -l fr-fr -l hi-in -l it-it -l ja-jp -l kk-kz -l nl-nl -l pl-pl -l pt-br -l ro-ro -l ru-ru -l zh-hans -a core -a geo -a payments -a vibes_auth -a blog -a root
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "Translated successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "You can now use compile-messages.ps1 script." -ForegroundColor Cyan