njfranck has asked for the wisdom of the Perl Monks concerning the following question:
See? I request language "nl", but I get the handle for "en". The opposite works as expected (at least as I expect it):package Loc; use parent "Locale::Maketext"; use Locale::Maketext::Lexicon { en => [ Gettext => \*main::DATA ] }; package main; use strict; print ( Loc->get_handle("nl") ? "ERROR: should be undef" : "OK: got un +def" ); print "\n"; __DATA__ msgid "greet" msgstr "hello %1"
Any idea of how to disable this fallback behaviour? I read something about the method "language_languages" in Locale::Maketext, but that does not make any difference.package Loc; use parent "Locale::Maketext"; use Locale::Maketext::Lexicon { nl => [ Gettext => \*main::DATA ] }; package main; use strict; print ( Loc->get_handle("en") ? "ERROR: should be undef" : "OK: got un +def" ); print "\n"; __DATA__ msgid "greet" msgstr "hello %1"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Disable use of fallback language in Locale::Maketext::Lexicon
by Eily (Monsignor) on Oct 09, 2018 at 13:59 UTC | |
by njfranck (Initiate) on Oct 16, 2018 at 06:59 UTC |