Fixes: 1) Remove obsolete `reboot` scripts for Unix and Windows to prevent redundancy; 2) Update Windows `test.ps1` to handle omitted coverage patterns and improve error feedback. Extra: 1) Refactor Windows scripts (`make-messages.ps1`, `compile-messages.ps1`, `backup.ps1`) to use shared utilities for better consistency and output formatting; 2) Add spinner-based progress indicators to enhance user experience in interactive environments.
38 lines
1.2 KiB
PowerShell
38 lines
1.2 KiB
PowerShell
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Load shared utilities
|
|
$utilsPath = Join-Path $PSScriptRoot '..\lib\utils.ps1'
|
|
. $utilsPath
|
|
|
|
.\scripts\Windows\starter.ps1
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
if (-not (Test-Path '.env'))
|
|
{
|
|
Write-Warning-Custom ".env file not found. Exiting without running Docker steps."
|
|
exit 0
|
|
}
|
|
|
|
# Check placeholders
|
|
Write-Step "Checking placeholders in PO files..."
|
|
docker compose exec app uv run manage.py check_translated -l ALL -a ALL
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error-Custom "PO files have placeholder issues"
|
|
exit $LASTEXITCODE
|
|
}
|
|
Write-Success "PO files have no placeholder issues!"
|
|
|
|
# Compile messages
|
|
Write-Step "Compiling PO files into MO files..."
|
|
docker compose exec app uv run manage.py compilemessages -l ar_AR -l cs_CZ -l da_DK -l de_DE -l en_GB -l en_US -l es_ES -l fa_IR -l fr_FR -l he_IL -l hi_IN -l hr_HR -l id_ID -l it_IT -l ja_JP -l kk_KZ -l ko_KR -l nl_NL -l no_NO -l pl_PL -l pt_BR -l ro_RO -l ru_RU -l sv_SE -l th_TH -l tr_TR -l vi_VN -l zh_Hans
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error-Custom "Failed to compile messages"
|
|
exit $LASTEXITCODE
|
|
}
|
|
Write-Success "Compiled successfully!"
|
|
|
|
Write-Result ""
|
|
Write-Result "Translation compilation complete!"
|