From: Ævar Arnfjörð Bjarmason Date: Sat, 26 Sep 2009 20:03:52 +0000 (+0000) Subject: Deal with values which are arrays, before and after: X-Git-Tag: live~7243 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/088bd1dcb2d2fb223354957e4307b4802ff25442 Deal with values which are arrays, before and after: avar@aoeu:~/src/osm/sites/rails_port/config/locales$ perl ../../script/locale/diff --dump-flat de.yml|egrep "Nähe|Uni" message.inbox.people_mapping_nearby: Mappern in deiner Nähe message.outbox.people_mapping_nearby: Mappern in deiner Nähe - "Universit\xC3\xA4t" user.friend_map.nearby mapper: "Mapper in der Nähe: [[nearby_user]]" user.view.nearby users: "Benutzer in der Nähe:" user.view.no nearby users: Es gibt bisher keine Benutzer, die einen Standort in deiner Nähe angegeben haben. avar@aoeu:~/src/osm/sites/rails_port/config/locales$ perl ../../script/locale/diff --dump-flat de.yml|egrep "Nähe|Uni" message.inbox.people_mapping_nearby: Mappern in deiner Nähe message.outbox.people_mapping_nearby: Mappern in deiner Nähe - Universität user.friend_map.nearby mapper: "Mapper in der Nähe: [[nearby_user]]" user.view.nearby users: "Benutzer in der Nähe:" user.view.no nearby users: Es gibt bisher keine Benutzer, die einen Standort in deiner Nähe angegeben haben. --- diff --git a/script/locale/diff b/script/locale/diff index e45b8e3c6..aa44ea53d 100755 --- a/script/locale/diff +++ b/script/locale/diff @@ -111,7 +111,7 @@ my $from_parsed = { iterate($from_data->{fileparse($from, qr/\.[^.]*/)}) }; if ($dump_flat) { # Mark as UTF-8 - map { utf8::decode($_) } values %$from_parsed; + map { if (ref $_ eq 'ARRAY') { map { utf8::decode($_) } @$_ } else { utf8::decode($_) } } values %$from_parsed; print Dump $from_parsed;