Created
July 15, 2015 21:22
-
-
Save MattKetmo/609e1c83d815054ec86e to your computer and use it in GitHub Desktop.
Debug XLIFF file loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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