-
Notifications
You must be signed in to change notification settings - Fork 49
ember-intl
integration
#2878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zamoore
wants to merge
77
commits into
main
Choose a base branch
from
zamoore/hds-4856/ember-intl-spike
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,144
−67
Open
ember-intl
integration
#2878
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
5a5bac5
using test helpers import path
zamoore 41ae6ed
fixing import
zamoore 9f84f26
first run at translations
zamoore 97a36c8
updated lockfile
zamoore 4101b01
fixed template string
zamoore 53787a0
fixing translations
zamoore 4496ddf
fixing failing test
zamoore 678005a
fixing tests
zamoore 2a8c971
linting for @text values
zamoore 632e7c6
fixing intl test setup
zamoore 053b192
added missing translation
zamoore d63f470
removed translation
zamoore b915cfb
setting up rendering tests correctly
zamoore 0bb2952
fixed failing tests
zamoore 79c0c7b
added changeset
zamoore d99e0c4
fixing pagination translation
zamoore 3591fd1
fixing tests
zamoore 3f9685b
added missed translation
zamoore e0a6028
responding to pr feedback
zamoore bdb929b
fixing malformed translations
zamoore f6da0ee
downgraded ember-intl to work with cloud-ui
zamoore 0f12770
Apply suggestions from code review
zamoore a56ad2a
made ember-intl optional
zamoore f65ba78
moved translations to sep files
zamoore 8ec1f68
updating import
zamoore 6220d07
setting up namespaces
zamoore 5b95ae5
fix file extension
zamoore e767ef5
fixing translation keys
zamoore f46fc84
fix dash character
zamoore 210b73a
working on making things work in projects without ember-intl
zamoore ea67c2f
fixing use of t helper
zamoore 1ba0ac0
adding polyfill for ember-getowner
zamoore 8dea761
trying the deprecated getOwner
zamoore 63bc592
added integration test for hds-t helper
zamoore d10a4e4
addressed trailing comma issue
zamoore 68d2c20
addressing pr feedback
zamoore ba317ea
removed custom lint plugin
zamoore df0380e
removed unused rule
zamoore d894a71
setting the 3.28lts version to be allowed to fail
zamoore f412416
firming up deps and docs
zamoore d952e21
adding a translation demo page
zamoore 00cf2fe
adding multiple languages
zamoore af089e7
adding docs
zamoore 673b75b
revert accidental change
zamoore 7ad7647
added service wrapper and use it instead in helper
zamoore af073d7
fixing tests
zamoore 3dfc52c
responding to PR feedback
zamoore 6a39b80
namespaces translations
zamoore bda2eb4
updated changelog
zamoore cfcc2ac
fixing tests
zamoore b2f849f
changed back to cjs file
zamoore 08b9d55
changed back to cjs file
zamoore 21ff4fc
fixing tons of files added to build
zamoore 72386da
changing the rollup config
zamoore 2c76fdc
updated rollup config to be more explicit
zamoore 8e86d08
updating rollup config
zamoore 72ce039
fixing typo
zamoore 0c93e8e
fixed overeager find and replace
zamoore 8be1541
responding to pr feedback
zamoore 78b3b2e
fixing build issues
zamoore 8339ab4
fixing tests
zamoore 8b54ae3
added translations for values outside of templates
zamoore 0e6d7e1
added override examples
zamoore 35ea344
fixing linting error
zamoore ae65b27
revert bad path changes
zamoore 197a750
Apply suggestions from code review
zamoore d045fb3
removed extraneous change
zamoore 99e97de
removed extraneous change
zamoore 50d25f7
reverting unneeded change
zamoore 7e6f44c
removing quotes from translations
zamoore c1b530f
responding to PR feedback
zamoore 0b495a6
code clion up
zamoore 9193a98
code cleann up
zamoore daa9920
small tweaks to the showcase page for the `internationalization`
didoo 2bc8708
removed empty container
didoo 0552e94
responding to pr feedback
zamoore 4bbfefd
responding to PR feedback
zamoore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
--- | ||
"@hashicorp/design-system-components": minor | ||
--- | ||
|
||
- Added `ember-intl` as a dependency | ||
- Added `hdsIntl` service for translations with default fallback values | ||
- Added `hds-t` helper which uses the `hds-intl` service to provide translations in templates | ||
|
||
`AdvancedTable` - Translated template strings. Removed extraneous screen-reader-only text. | ||
|
||
`AppFooter` - Translated template strings | ||
|
||
`AppSideNav` - Translated template strings | ||
|
||
`ApplicationState` - Translated template strings | ||
|
||
`CodeEditor` - Translated template strings | ||
|
||
`DismissButton` - Translated template strings | ||
|
||
`MaskedInput` - Translated template strings | ||
|
||
`SuperSelect` - Translated template strings | ||
|
||
`Pagination` - Translated template strings | ||
|
||
`SideNav` - Translated template strings | ||
|
||
`Table` - Translated template strings | ||
|
||
`Time` - Translated template strings |
This file contains hidden or 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 hidden or 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,95 @@ | ||
'use strict'; | ||
|
||
module.exports = function (/* environment */) { | ||
return { | ||
/** | ||
* Cause a build error if missing translations are detected. | ||
* | ||
* See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#throwing-a-build-error-on-missing-when-required-translations | ||
* | ||
* @property errorOnMissingTranslations | ||
* @type {Boolean} | ||
* @default "false" | ||
*/ | ||
errorOnMissingTranslations: false, | ||
|
||
/** | ||
* Cause a build error if ICU argument mismatches are detected between translations | ||
* with the same key across all locales. | ||
* | ||
* @property errorOnNamedArgumentMismatch | ||
* @type {Boolean} | ||
* @default "false" | ||
*/ | ||
errorOnNamedArgumentMismatch: false, | ||
|
||
/** | ||
* Merges the fallback locale's translations into all other locales as a | ||
* build-time fallback strategy. | ||
* | ||
* This will **not** prevent missing translation warnings or errors from occurring. | ||
* It's meant as safety net when warnings are enabled. | ||
* When enabled along with `errorOnMissingTranslations` any fallback attempts will result in an error. | ||
* | ||
* @property fallbackLocale | ||
* @type {String?} | ||
* @default "null" | ||
*/ | ||
fallbackLocale: null, | ||
|
||
/** | ||
* Path where translations are stored. This is relative to the project root. | ||
* For example, if your translations are an npm dependency, set this to: | ||
*`'./node_modules/path/to/translations'` | ||
* | ||
* @property inputPath | ||
* @type {String} | ||
* @default "'translations'" | ||
*/ | ||
inputPath: 'translations', | ||
|
||
/** | ||
* Prevents the translations from being bundled with the application code. | ||
* This enables asynchronously loading the translations for the active locale | ||
* by fetching them from the asset folder of the build. | ||
* | ||
* See: https://ember-intl.github.io/ember-intl/docs/guide/asynchronously-loading-translations | ||
* | ||
* @property publicOnly | ||
* @type {Boolean} | ||
* @default "false" | ||
*/ | ||
publicOnly: false, | ||
|
||
/** | ||
* A function that is called whenever any translation key, from any locale, is missing at build time. | ||
* | ||
* See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#requiring-translations | ||
* | ||
* @property requiresTranslation | ||
* @type {Function} | ||
* @default "function(key,locale) { return true }" | ||
*/ | ||
requiresTranslation(/* key, locale */) { | ||
return true; | ||
}, | ||
|
||
/** | ||
* Removes empty translations from the build output. | ||
* | ||
* @property stripEmptyTranslations | ||
* @type {Boolean} | ||
* @default "false" | ||
*/ | ||
stripEmptyTranslations: false, | ||
|
||
/** | ||
* Add the subdirectories of the translations as a namespace for all keys. | ||
* | ||
* @property wrapTranslationsWithNamespace | ||
* @type {Boolean} | ||
* @default "false" | ||
*/ | ||
wrapTranslationsWithNamespace: true, | ||
}; | ||
}; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.