Skip to content

Add --lang and file listing to sync XML tools#275

Merged
alfsb merged 2 commits intophp:masterfrom
lacatoire:sync-tools-lang-param
Feb 12, 2026
Merged

Add --lang and file listing to sync XML tools#275
alfsb merged 2 commits intophp:masterfrom
lacatoire:sync-tools-lang-param

Conversation

@lacatoire
Copy link
Contributor

Summary

  • Add --lang=XX parameter to all qaxml-*.php scripts, allowing direct language specification without requiring temp/lang from configure.php
  • Add simple file listing support: pass file paths as positional arguments to check specific files instead of the full translation tree
  • Existing behavior without parameters is fully preserved (backward compatible)

Usage examples

# Existing usage (unchanged)
php scripts/translation/qaxml-attributes.php

# New: specify language directly
php scripts/translation/qaxml-attributes.php --lang=fr

# New: check specific files only
php scripts/translation/qaxml-tags.php --lang=de reference/strings/functions/strlen.xml

# New: combine with existing options
php scripts/translation/qaxml-entities.php --urgent --lang=ja -trim

Files changed

  • scripts/translation/libqa/SyncFileList.php — accept optional $lang and $files parameters
  • scripts/translation/qaxml-attributes.php — parse --lang= and file args
  • scripts/translation/qaxml-entities.php — parse --lang= and file args
  • scripts/translation/qaxml-pi.php — parse --lang= and file args
  • scripts/translation/qaxml-tags.php — parse --lang= and file args
  • scripts/translation/qaxml-revtag.php — parse --lang= and file args
  • scripts/translation/qaxml-ws.php — parse --lang= and file args

Relates to #199 (Sync XML tools to accept language parameter and simple file listing)

@lacatoire lacatoire requested a review from alfsb as a code owner February 10, 2026 09:11
Allow all qaxml-*.php scripts to accept --lang=XX to specify the
target language directly, without requiring temp/lang from
configure.php. Also accept file paths as positional arguments
for checking specific files instead of the full translation tree.

Existing behavior without parameters is preserved. Relates to php#199.
@lacatoire lacatoire force-pushed the sync-tools-lang-param branch from e236d3f to 00d86bc Compare February 10, 2026 09:19
Copy link
Member

@alfsb alfsb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, and also thanks for keeping the coding style of these tools (it's weird, I know).

I will try to test this in the following days. and will wait some days/weeks for the requested changes.

If you're feeling particularly adventurous, you may also rename the files and class names from SyncFileList/Item to FilePairList/Item.

@lacatoire
Copy link
Contributor Author

Maybe another pr ? if merged i will create an issue

Address review feedback: rename parameter for clarity and add
STDERR warning when a command-line file is not found in sourceDir.
@alfsb
Copy link
Member

alfsb commented Feb 12, 2026

Thanks for the changes. It may take a few days before I can borrow a Windows box and test this, before merging.

Maybe another pr ? if merged i will create an issue

Nah. I will make these internal changes later. There are also a bunch of header's comments that are plain wrong, so I will fix these in one go.

@alfsb alfsb merged commit 25287df into php:master Feb 12, 2026
10 of 12 checks passed
@lacatoire lacatoire deleted the sync-tools-lang-param branch February 13, 2026 07:41
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