2
0

phrase.pl 662 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/perl
  2. #
  3. # Phrase verification and generation script.
  4. #
  5. use XML::Simple;
  6. use Data::Dumper;
  7. my $ref = XMLin("phrase_en.xml");
  8. foreach $language ( sort keys %{$ref}) {
  9. foreach $item ( sort keys %{$ref->{$language}}) {
  10. foreach $element ( sort keys %{$ref->{$language}->{$item}}) {
  11. #print "Language: $language, $item, $element\n";
  12. system("mkdir -p $language/$item");
  13. foreach $foo (@{$ref->{$language}->{$item}->{$element}}) {
  14. #print "filename: $language/$item/$foo->{filename} contains phrase \"$foo->{phrase}\"\n";
  15. # insert command to verify or generate files here
  16. print "$item/8000/$foo->{filename}\n";
  17. }
  18. }
  19. }
  20. }