-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an optional "absolute" flage to translationKeyExists
This flag allows us to ask not just that a translation key exists, but also whether it is an "absolute" key, ie. one that can be used by `i18n.translate`. Currently the method just checks whether a subtree exists with the given key, but that tree is not necessarily a leaf node that would result in a translated string, just a translated set of objects. This flag allows us the ability to safely check that a translation exists before calling translate() to avoid triggering onError.
- Loading branch information
1 parent
a9f4dad
commit 3d072b0
Showing
3 changed files
with
40 additions
and
2 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,5 @@ | ||
--- | ||
'@shopify/react-i18n': minor | ||
--- | ||
|
||
Add absolute option to I18n#translationKeyExists |
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