Skip to content

Commit 3613b79

Browse files
authored
Created de-de translations (#111)
* Temporarily set the default locale to de-de * Created translations for the application * Created translations for Generating Files * Created translations for Component Templates * Created translations for Component Properties * Created translations for Actions * Created translations for Component Lifecycle * Created translations for Routes * Revert "Temporarily set the default locale to de-de" This reverts commit fbd41593d75b309f0e00c1fe75d2c3628c10b0a7. * Added Percy snapshot --------- Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
1 parent 19d6c15 commit 3613b79

File tree

48 files changed

+222
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+222
-9
lines changed

app/services/locale.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import Service, { service } from '@ember/service';
44
To help with maintainenance, please list
55
the supported locales in alphabetical order.
66
*/
7-
const supportedLocales = new Set(['en-US', 'es', 'fr-FR', 'ja', 'pt-BR']);
7+
const supportedLocales = new Set([
8+
'de-DE',
9+
'en-US',
10+
'es',
11+
'fr-FR',
12+
'ja',
13+
'pt-BR',
14+
]);
815

916
export default class LocaleService extends Service {
1017
@service intl;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{my-component answer=42}}
1+
{{my-component answer=answer}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<MyComponent @answer={{42}} />
1+
<MyComponent @answer={{@answer}} />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { visit } from '@ember/test-helpers';
2+
import percySnapshot from '@percy/ember';
3+
import { setupIntl } from 'ember-intl/test-support';
4+
import { setupApplicationTest } from 'ember-qunit';
5+
import { module, test } from 'qunit';
6+
7+
module('Acceptance | Homepage | de-DE', function (hooks) {
8+
setupApplicationTest(hooks);
9+
setupIntl(hooks, 'de-de');
10+
11+
test('Percy snapshot', async function (assert) {
12+
await visit('/');
13+
await percySnapshot(assert);
14+
15+
assert.ok(true);
16+
});
17+
18+
test('We set the correct lang attribute in <html> element', async function (assert) {
19+
await visit('/');
20+
21+
assert
22+
.dom(document.querySelector('html'))
23+
.hasAttribute('lang', 'de-de', 'We set the correct lang attribute.');
24+
});
25+
});

tests/integration/components/locale-menu-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module('Integration | Component | locale-menu', function (hooks) {
1919

2020
assert
2121
.dom('[data-test-option]')
22-
.exists({ count: 5 }, 'There are 5 non-default options.');
22+
.exists({ count: 6 }, 'There are 6 options.');
2323
});
2424

2525
test('allows the user to update the site locale', async function (assert) {

tests/unit/services/locale-test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ module('Unit | Service | locale', function (hooks) {
99

1010
assert.deepEqual(
1111
locale.menuOptions.map(({ label }) => label),
12-
['English (US)', 'Français', 'Português (do Brasil)', 'Spanish', '日本語']
12+
[
13+
'Deutsch (DE)',
14+
'English (US)',
15+
'Français',
16+
'Português (do Brasil)',
17+
'Spanish',
18+
'日本語',
19+
]
1320
);
1421
});
1522
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: "@action, '{{on}}' und '{{fn}}' statt '{{action}}'"
2+
description: >
3+
Markieren Sie mit dem '<code>'@action'</code>' Decorator die Funktion einer JavaScript-Klasse, die vom Template aufgerufen werden sollte.
4+
Verwenden Sie den '<code>{{on}}</code>' Modifizierer, um über das Wann zu entscheiden.
5+
Wenn Sie der Funktion ein Argument übergeben wollen, fügen Sie auch den '<code>{{fn}}</code>' Helfer hinzu.
6+
('<a href="https://guides.emberjs.com/release/components/component-state-and-actions/#toc_html-modifiers-and-actions" target="_blank" rel="noopener noreferrer">'Besuchen Sie die Ember Guides, um mehr zu erfahren'</a>'.)

translations/actions/actions/en-us.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: Use @action, '{{on}}', and '{{fn}}' instead of actions
1+
title: Use @action, '{{on}}', and '{{fn}}' instead of '{{action}}'
22
description: >
33
In the JavaScript class, use the '<code>'@action'</code>' decorator to mark the function that you want to call from the template.
44
In the template, use the '<code>{{on}}</code>' modifier to decide when to call the function.

translations/actions/actions/es.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: Use @action, '{{on}}', y '{{fn}}' en lugar de acciones
1+
title: Use @action, '{{on}}', y '{{fn}}' en lugar de '{{action}}'
22
description: >
33
En la clase de JavaScript, use el decorador '<code>'@action'</code>' para marcar la función que desea llamar desde el template.
44
En el template, use el modificador '<code>{{on}}</code>' para decidir cuándo llamar a la función.

translations/actions/actions/ja.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: actionsの代わりに、@action、'{{on}}'、そして'{{fn}}'を使う
1+
title: "'{{action}}'の代わりに、@action、'{{on}}'、そして'{{fn}}'を使う"
22
description: >
33
JavaScriptのクラスで、テンプレートから呼び出したい関数には'<code>'@action'</code>'デコレーターで関数をマークする必要があります。
44
テンプレートでは、'<code>{{on}}</code>'修飾子を使うことでいつ関数を呼ぶかを決めることが出来ます。

0 commit comments

Comments
 (0)