diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-02-24 15:27:23 +0000 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-02-24 15:27:23 +0000 |
commit | 7c9a89eedb17bdafbc171bba5de21cdd5725acd7 (patch) | |
tree | 3603445333afb5821ef568711b66d274fac067b6 /t/i18n.t | |
parent | b327a36371ea3c0151452ae5e516e63c5fc53b54 (diff) |
Explicitly set gettext_dir so that it does not matter where calling script file is located
Diffstat (limited to 't/i18n.t')
-rw-r--r-- | t/i18n.t | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -10,7 +10,7 @@ use mySociety::Locale; die "You need to run 'commonlib/bin/gettext-makemo --quiet FixMyStreet' " . "to generate the *.mo files needed." unless -e FixMyStreet->path_to( - 'locale/cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.mo'); + 'locale/cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.mo'); # Example strings my $english = "Sorry! Something's gone wrong."; @@ -29,4 +29,11 @@ is _($english), $english, "english to english"; mySociety::Locale::change('cy'); is _($english), $welsh, "english to welsh"; +# check that being in a deep directory does not confuse the code +chdir FixMyStreet->path_to('t/app/controller') . ''; +mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', 1, + FixMyStreet->path_to('locale')->stringify ); +mySociety::Locale::change('cy'); +is _($english), $welsh, "english to welsh (deep directory)"; + done_testing(); |