middleman/middleman-more/features/i18n_force_locale.feature
Ben Hollis 4d5c509688 Fix several issues around i18n and resource metadata.
There are a few things changing here. One is that we always dup metadata before using it - this prevents a class of nasty bugs where after the first resource list build, blocks had been deleted from metadata hashes, meaning they would no longer be applied. Now they will always stick around. Then, I made sure that whenever we render a file, we save the previous I18n.locale and restore it afterwards, in case people change locale from blocks. This should help in some weird cases where files are rendered recursively. Finally, I've added a :lang option that can be used from "page" or "proxy" to allow people to specify the language for one or more files without having to pass a block that sets I18n.locale directly, which should make that pattern much cleaner. This fixes #809 and may also fix middleman/middleman-blog#106.
2013-04-03 00:07:31 -07:00

14 lines
492 B
Gherkin

Feature: i18n manually setting locale
Scenario: Setting I18n.locale in a block (see issue #809) or with the :lang option
Given the Server is running at "i18n-force-locale"
When I go to "/en/index.html"
Then I should see "Hello"
Then I should see "I18n.locale: en"
When I go to "/es/index.html"
Then I should see "Hola"
Then I should see "I18n.locale: es"
When I go to "/fr/index.html"
Then I should see "Bonjour"
Then I should see "I18n.locale: fr"