Akron | fef9478 | 2015-06-10 21:31:53 +0200 | [diff] [blame] | 1 | # Based on Mojolicious::Plugin::Number::Commify |
| 2 | my $THOUSAND_SEP_RE = qr/( |
| 3 | ^[-+]? # beginning of number. |
| 4 | \d+? # first digits before first comma |
| 5 | (?= # followed by, (but not included in the match) : |
| 6 | (?>(?:\d{3})+) # some positive multiple of three digits. |
| 7 | (?!\d) # an *exact* multiple, not x * 3 + 1 or whatever. |
| 8 | )| # or: |
| 9 | \G\d{3} # after the last group, get three digits |
| 10 | (?=\d) # but they have to have more digits after them. |
| 11 | )/x; |
| 12 | |
| 13 | { |
| 14 | _ => sub { $_->locale }, |
| 15 | de => { |
| 16 | numf => sub { |
| 17 | shift; |
| 18 | my %val = @_; |
| 19 | my $num = $val{number} or return 0; |
| 20 | $num =~ s/$THOUSAND_SEP_RE/$1\./g; |
| 21 | return $num; |
| 22 | }, |
| 23 | about => 'Über KorAP', |
| 24 | login => 'Anmelden', |
| 25 | searchtitle => 'KorAP: Finde "<%== $q %>" (<%= $ql %>)', |
| 26 | searchplaceholder => 'Finde ...', |
| 27 | go => 'Los!', |
| 28 | in => 'in', |
| 29 | by => 'von', |
| 30 | with => 'mit', |
| 31 | glimpse => { |
| 32 | -short => 'Stichprobe', |
| 33 | desc => 'Zeige nur die ersten Treffer in beliebiger Reihenfolge' |
| 34 | }, |
| 35 | faq => 'Häufige Fragen', |
| 36 | tutorial => 'Einführung', |
| 37 | pubOn => 'veröffentlicht am', |
| 38 | matchCount => 'Treffer', |
| 39 | noMatches => 'Es wurden keine Treffer für <code><%= stash("q") %></code> gefunden.', |
| 40 | notFound => '404 - Seite nicht gefunden', |
| 41 | jsFile => 'kalamar-<%= $Kalamar::VERSION %>-de.js', |
| 42 | underConstruction => 'In Vorbereitung!', |
| 43 | korap => { |
| 44 | -short => 'KorAP', |
| 45 | desc => 'KorAP - Korpusanalyseplattform der nächsten Generation', |
| 46 | overview => 'KorAP - Übersicht', |
| 47 | }, |
| 48 | template => { |
| 49 | intro => 'de/intro' |
| 50 | } |
| 51 | }, |
| 52 | -en => { |
| 53 | numf => sub { |
| 54 | shift; |
| 55 | my %val = @_; |
| 56 | my $num = $val{number} or return 0; |
| 57 | $num =~ s/$THOUSAND_SEP_RE/$1\,/g; |
| 58 | return $num; |
| 59 | }, |
| 60 | about => 'About KorAP', |
| 61 | login => 'Login', |
| 62 | go => 'Go!', |
| 63 | searchtitle => 'KorAP: Find "<%== $q %>" (<%= $ql %>)', |
| 64 | searchplaceholder => 'Find ...', |
| 65 | in => 'in', |
| 66 | by => 'by', |
| 67 | with => 'with', |
| 68 | pubOn => 'published on', |
| 69 | matchCount => '<%= num($found, "match", "matches") %>', |
| 70 | noMatches => 'There were no matches for <code><%= stash("q") %></code>.', |
| 71 | notFound => '404 - Page not found', |
| 72 | glimpse => { |
| 73 | -short => 'Sample', |
| 74 | desc => 'Just show the first matches in arbitrary order' |
| 75 | }, |
| 76 | faq => 'F.A.Q.', |
| 77 | underConstruction => 'Under Construction!', |
| 78 | tutorial => 'Tutorial', |
| 79 | korap => { |
| 80 | -short => 'KorAP', |
| 81 | desc => 'KorAP - Corpus Analysis Platform', |
| 82 | overview => 'KorAP - Overview' |
| 83 | } |
| 84 | } |
| 85 | }; |