Skip to content

Instantly share code, notes, and snippets.

@MattKetmo
Created July 15, 2015 21:22
Show Gist options
  • Save MattKetmo/609e1c83d815054ec86e to your computer and use it in GitHub Desktop.
Save MattKetmo/609e1c83d815054ec86e to your computer and use it in GitHub Desktop.
Debug XLIFF file loading
<?php
<<<CONFIG
packages:
- "symfony/translation: v2.6.4"
- "symfony/config: v2.6.4"
CONFIG;
if (!isset($argv[1])) {
die('Usage: melody openl10n-debug.php <filename>.xlf');
}
$loader = new \Symfony\Component\Translation\Loader\XliffFileLoader();
$catalogue = $loader->load($argv[1], 'en', 'messages');
$translations = $catalogue->all('messages');
//var_dump($translations);
$count = count($translations);
echo "Loaded $count translations\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment