-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdfc614
commit 5a09186
Showing
22 changed files
with
124 additions
and
68 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
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
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
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
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
export default function t(str = "", replacementString, requestedKey) { | ||
return str; | ||
// const calculatedKey = str.toUpperCase() | ||
// .replace(/ /g, "_") | ||
// .replace(/[^a-zA-Z0-9\-\_\*\{\}\?]/g, "") | ||
// .replace(/\_+$/, ""); | ||
// const value = requestedKey === undefined ? | ||
// window.LNG && window.LNG[calculatedKey] : | ||
// window.LNG && window.LNG[requestedKey]; | ||
// return reformat( | ||
// value || str || "", | ||
// str, | ||
// ).replace("{{VALUE}}", replacementString); | ||
const calculatedKey = str.toUpperCase() | ||
.replace(/ /g, "_") | ||
.replace(/[^a-zA-Z0-9\-\_\*\{\}\?]/g, "") | ||
.replace(/\_+$/, ""); | ||
const value = requestedKey === undefined ? | ||
window.LNG && window.LNG[calculatedKey] : | ||
window.LNG && window.LNG[requestedKey]; | ||
return reformat( | ||
value || str || "", | ||
str, | ||
).replace("{{VALUE}}", replacementString); | ||
} | ||
|
||
// function reformat(translated, initial) { | ||
// if (initial[0] && initial[0].toLowerCase() === initial[0]) { | ||
// return translated || ""; | ||
// } | ||
// return (translated[0] && translated[0].toUpperCase() + translated.substring(1)) || ""; | ||
// } | ||
function reformat(translated, initial) { | ||
if (initial[0] && initial[0].toLowerCase() === initial[0]) { | ||
return translated || ""; | ||
} | ||
return (translated[0] && translated[0].toUpperCase() + translated.substring(1)) || ""; | ||
} |
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
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
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
Oops, something went wrong.