]> git.openstreetmap.org Git - rails.git/blobdiff - script/locale/diff
Merge 16110:16487 from trunk.
[rails.git] / script / locale / diff
index 8ce35ad5c64bc90c9b4a34965aed1f4fb18b03a9..0335fe9836037e8195db56e699b42a70e5e2ea98 100755 (executable)
@@ -2,7 +2,7 @@
 use feature ':5.10';
 use strict;
 use warnings;
-use YAML::Syck qw(Load LoadFile);
+use YAML::Syck qw(LoadFile);
 use Test::Differences;
 use Pod::Usage ();
 use Getopt::Long ();
@@ -18,7 +18,7 @@ locale-diff - Compare two YAML files and print how their datastructures differ
     diff --keys en.yml is.yml
 
     # --untranslated-values compares prints keys whose values don't differ
-    diff --untranslated-values-all en.yml is.yml
+    diff --untranslated-values en.yml is.yml
 
     # --untranslated-values-all compares prints keys whose values
     # don't differ. Ignoring the blacklist which prunes things
@@ -50,10 +50,12 @@ new entries from F<en.yml> to a local file.
 
 =item --untranslated-values
 
-Show keys whose values are either exactly the same between the two
-files, or don't exist in the target file (the latter file
-specified). The values are pruned according to global and language
-specific blacklists found in the C<__DATA__> section of this script.
+Show keys that B<exist in both the compared files> and whose values
+are exactly the same. Use C<--keys> to a list of values that hasn't
+been merged.
+
+The values are pruned according to global and language specific
+blacklists found in the C<__DATA__> section of this script.
 
 This helps to find untranslated values.
 
@@ -138,7 +140,7 @@ sub print_key_differences
 sub untranslated_keys
 {
     my ($from_parsed, $to_parsed) = @_;
-    sort grep { not exists $to_parsed->{$_} or $from_parsed->{$_} eq $to_parsed->{$_} } keys %$from_parsed;
+    sort grep { exists $to_parsed->{$_} and $from_parsed->{$_} eq $to_parsed->{$_} } keys %$from_parsed;
 }
 
 sub prune_untranslated_with_blacklist
@@ -147,7 +149,7 @@ sub prune_untranslated_with_blacklist
     my %keys;
     @keys{@keys} = ();
 
-    my $end_yaml = Load(join '', <DATA>);
+    my $end_yaml = LoadFile(*DATA);
     my $untranslated_values = $end_yaml->{untranslated_values};
     my $default = $untranslated_values->{default};
     my $this_language = $untranslated_values->{$language} || {};
@@ -248,6 +250,8 @@ untranslated_values:
     layouts.project_name.h1: true
     layouts.project_name.title: true
     site.index.license.project_url: true
+    browse.relation_member.entry: true
+
   de:
     activerecord.attributes.message.sender: true
     activerecord.attributes.trace.name: true
@@ -284,3 +288,18 @@ untranslated_values:
     trace.view.tags: true
     user.account.public editing.enabled link: true
 
+  is:
+    # ({{link}})
+    site.edit.anon_edits: true
+
+    # Creative Commons Attribution-Share Alike 2.0
+    site.index.license.license_name: true
+
+    # http://creativecommons.org/licenses/by-sa/2.0/
+    site.index.license.license_url: true
+
+    # {{id}}
+    printable_name.with_id: true
+    
+    # {{name}} ({{id}})
+    printable_name.with_name: true