o, don't rely on the
# existence of these modules.
die "Please install JSON::XS" unless eval "require JSON::XS";
die "Please install Algorithm::Diff"
unless eval "require Algorithm:
r; my $el=$it->(); ) {
$#{$el}=nNOTE; # drop ID
$el->[nBLOCK]+=0; # convert to numbers because JSON::XS
$el->[nORDER]+=0; # shows 0 as 0 but '0' as "0"
push @my_stuff, $el if( (ref($key)
? $
r; my $el=$it->(); ) {
$#{$el}=nNOTE; # drop ID
$el->[nBLOCK]+=0; # convert to numbers because JSON::XS
$el->[nORDER]+=0; # shows 0 as 0 but '0' as "0"
push @other_stuff, $el if( (ref($key)
ted';
}
my $args=lc $r->args;
if( $args ne 'yaml' and eval 'require JSON::XS' ) {
$r->print( JSON::XS::encode_json
( {
TranslationKey=>$cf->{key},
TranslationProvider=>$cf->
key},
TranslationProvider=>$cf->{provider_param},
TranslationEvalCache=>$cache,
} ) );
} else {
die "Please install JSON::XS or YAML";
}
return Apache2::Const::OK;
}
1;
__END__
en notes are not
copied.
=item B<diff( $other_provider, %options )>
If L<Algorithm::Diff> and L<JSON::XS> are installed this method computes
a difference between 2 providers. If C<key> or C<uri> are
PTION
This module implements a simple C<modperl> handler that exports our
provider parameters in JSON or YAML to the WEB, e.g.:
$ curl http://localhost/-/config?yaml
---
TranslationEvalCache:
nfig
Since C<Apache2::Translation> version 0.31 JSON is default.
C<Apache2::Translation::Admin> can decode both formats provided the
L<YAML> and L<JSON::XS> modules are installed.
This format can be
ider_url);
if( $resp->is_success ) {
my $x;
unless( eval 'require JSON::XS' and
$x=eval {JSON::XS::decode_json($resp->content)} ) {
eval 'require YAML' and $x=eval {YAML::Load($re