Catalyst-Plugin-I18N-PathPrefixGeoIP

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/I18N/PathPrefixGeoIP.pm  view on Meta::CPAN


  my $config = $c->config->{'Plugin::I18N::PathPrefixGeoIP'};

  my $language_code = $config->{fallback_language};

  my $valid_language_codes = $config->{_valid_language_codes};

  my $req_path = $c->req->path;

  if ($req_path !~ $config->{language_independent_paths}) {
    my ($prefix, $path) = split m{/}, $req_path, 2;
    $prefix = lc $prefix if defined $prefix;
    $path   = '' if !defined $path;

    if (defined $prefix && exists $valid_language_codes->{$prefix}) {
      $language_code = $prefix;

      $c->_language_prefix_debug("found language prefix '$language_code' "
        . "in path '$req_path'");

      # can be a language independent path with surplus language prefix



( run in 0.941 second using v1.01-cache-2.11-cpan-71847e10f99 )