Unverified Commit 4141822a authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

So _this_ is how Locale::Maketext's fallback works.

parent 4af3c0eb
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -447,9 +447,13 @@ sub startup {
				}
			}

			# de-DE is our fall-back language and thus always appended
			return Travelynx::Helper::Locales->get_handle( @languages,
				'de-DE' );
			my $handle = Travelynx::Helper::Locales->get_handle(@languages);
			my $fallback_handle
			  = Travelynx::Helper::Locales->get_handle('de-DE');

			$handle->fail_with(
				sub { $fallback_handle->maketext( @_[ 1 .. $#_ ] ) } );
			return $handle;
		}
	);

+9 −3
Original line number Diff line number Diff line
@@ -3,11 +3,17 @@ package Travelynx::Helper::Locales;
use strict;
use warnings;

#BEGIN { package Locale::Maketext; sub DEBUG() {1} };
#BEGIN { package Locale::Maketext::Guts; sub DEBUG() {1} };

use base qw(Locale::Maketext);

our %Lexicon = (
	_AUTO => 1,
);
# Uncomment this to show raw strings for untranslated content rather than
# falling back to German.

#our %Lexicon = (
#	_AUTO => 1,
#);

use Locale::Maketext::Lexicon {
	_decode => 1,