aboutsummaryrefslogtreecommitdiffstats
path: root/t/i18n.t
diff options
context:
space:
mode:
Diffstat (limited to 't/i18n.t')
-rw-r--r--t/i18n.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/i18n.t b/t/i18n.t
index e11589d8b..6a5d94fa2 100644
--- a/t/i18n.t
+++ b/t/i18n.t
@@ -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();