-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #480 from robinborst95/feature/in-repo-paths
Add support for translations in in-repo addons
- Loading branch information
Showing
13 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class ApplicationController extends Controller { | ||
get foo() { | ||
return this.intl.t('js-translation'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{t "hbs-translation"}} | ||
{{t "in-repo-addon.translation-outside-addon"}} |
7 changes: 7 additions & 0 deletions
7
fixtures/in-repo-translations/lib/in-repo-addon/addon/controllers/addon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class AddonController extends Controller { | ||
get foo() { | ||
return this.intl.t('in-repo-addon.addon.js-translation'); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
fixtures/in-repo-translations/lib/in-repo-addon/addon/templates/addon.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{t "in-repo-addon.addon.hbs-translation"}} | ||
{{t "translation-outside-app-in-addon"}} | ||
{{t "translation-missing-in-addon"}} |
7 changes: 7 additions & 0 deletions
7
fixtures/in-repo-translations/lib/in-repo-addon/app/controllers/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default class ApplicationController extends Controller { | ||
get foo() { | ||
return this.intl.t('in-repo-addon.app.js-translation'); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
fixtures/in-repo-translations/lib/in-repo-addon/app/templates/application.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{t "in-repo-addon.app.hbs-translation"}} | ||
{{t "translation-outside-app-in-app"}} | ||
{{t "translation-missing-in-app"}} |
9 changes: 9 additions & 0 deletions
9
fixtures/in-repo-translations/lib/in-repo-addon/translations/en.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
in-repo-addon: | ||
addon: | ||
hbs-translation: HBS in in-repo addon addon | ||
js-translation: JS in in-repo addon addon | ||
app: | ||
hbs-translation: HBS in in-repo addon app | ||
js-translation: JS in in-repo addon app | ||
translation-outside-addon: This translation is used outside the in-repo addon | ||
unused: This translation is unused |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "in-repo-translations", | ||
"ember-addon": { | ||
"paths": [ | ||
"lib/in-repo-addon" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hbs-translation: HBS! | ||
js-translation: JS! | ||
translation-outside-app-in-addon: This translation is only used in the addon folder of the addon | ||
translation-outside-app-in-app: This translation is only used in the app folder of the addon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters