Skip to content

Commit

Permalink
Merge pull request #212 from kaliber5/en-default
Browse files Browse the repository at this point in the history
Make en the default locale in testing
  • Loading branch information
simonihmig authored Sep 29, 2021
2 parents bff6f23 + 81f5ad1 commit b4f0ec5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import Intl from 'ember-intl/services/intl';
import { isTesting, macroCondition } from '@embroider/macros';

export default class ApplicationRoute extends Route {
@service intl!: Intl;

beforeModel(): void | Promise<unknown> {
this.intl.setLocale('de-de');
queryParams = {
locale: { refreshModel: true },
};

model({ locale = macroCondition(isTesting()) ? 'en-us' : 'de-de' }: { locale: string }): void {
this.intl.setLocale(locale);
}

afterModel(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Scenario: Page not found when visiting [URL]

When I visit URL "[URL]"
Then there should be an Error-Message
And the Title in the Error-Message should have text "Etwas ist schiefgelaufen!"
And the Description in the Error-Message should have text "Seite wurde nicht gefunden."
And the Link in the Error-Message should have text "zurück zur Startseite"
And the Title in the Error-Message should have text "Something went wrong!"
And the Description in the Error-Message should have text "Page not found."
And the Link in the Error-Message should have text "Back to homepage"
And the Link in the Error-Message should have HTML attr "href" with value "/"

Where:
Expand Down
1 change: 1 addition & 0 deletions blueprints/@kaliber5/k5-ember-boilerplate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
async afterInstall(/* options */) {
await this.addAddonsToProject({
packages: [
{ name: '@embroider/macros' },
{ name: 'ember-bootstrap' },
{ name: 'ember-cli-dotenv' },
{ name: 'ember-cli-favicon' },
Expand Down

0 comments on commit b4f0ec5

Please sign in to comment.