Leaked source code of windows server 2003
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.

54 lines
853 B

  1. use strict;
  2. use IO::File;
  3. #
  4. # tok_lang.pl
  5. #
  6. # Arguments: none
  7. #
  8. # Purpose:
  9. #
  10. # Returns: 0 if success, non-zero otherwise
  11. #
  12. my( $File ) = "";
  13. my( $Line ) = "";
  14. my( $Lang ) = "";
  15. if ($ARGV[0] eq "") {
  16. print( "Invalid argument 1! No filename given.\n" );
  17. exit( 1 );
  18. }
  19. if ($ARGV[1] eq "") {
  20. print( "Invalid argument 2! No 3 character language code given.\n" );
  21. exit( 1 );
  22. }
  23. $File = $ARGV[0];
  24. $Lang = $ARGV[1];
  25. if ( &SearchReplaceInFile ) {
  26. print( "Failed to update Language local.\n" );
  27. exit( 1 );
  28. }
  29. #
  30. # SearchReplaceInFile
  31. #
  32. # Arguments: none
  33. #
  34. # Purpose:
  35. #
  36. # Returns:
  37. #
  38. sub SearchReplaceInFile
  39. {
  40. open FILE, $File;
  41. while (<FILE>) {
  42. $Line = $_;
  43. $Line =~ s/LOC/$Lang/;
  44. print( $Line );
  45. }
  46. close(FILE);
  47. return( 0 );
  48. }