anonymous group photoblog software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
648 B

  1. #!/bin/sed -rf
  2. # usage: ./strings.sed strings_en.pl > strings.py
  3. s/use constant S_([A-Z0-9_]+) ?=> ?(['"].*['"]|[0-9\*]+);(\s*#?.*)$/\1 = \2\3/;
  4. s/use constant S_([A-Z0-9_]+) ?=> ?\(?(['"].*['"])\);(\s*#?.*)$/\1 = [\2]\3/;
  5. s/use constant S_([A-Z0-9_]+) ?=> ?(['"].*['"])\. *$/\1 = \2 + \\/;
  6. # multiline strings
  7. s/^\s+(['"].*['"])\.\s*$/ \1 + \\/;
  8. s/^\s+(['"].*['"]);(\s*#?.*)$/ \1\2/;
  9. # S_OEKPAINTERS
  10. s/use constant S_([A-Z0-9_]+) ?=> ?\[\s*$/\1 = [/;
  11. /^\s*\{/ {
  12. s/\{ /{"/;
  13. s/ \}/}/;
  14. s/=>/"\: /g;
  15. }
  16. s/^\];\s*$/]/;
  17. s/^1;$//;
  18. # try to normalize whitespace
  19. s/\t/ /g;
  20. s/^(.{60})\s*#/\1 #/;
  21. s/^(.{60}.*['"])\s*#/\1 #/;