pseudo-localization
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -73,4 +73,4 @@ const pseudoLocalization = (() => { | ||
node => { | ||
const isAllWs = !/[^\t\n\r ]/.test(node.nodeValue); | ||
// A comment node or a text node, all ws | ||
const isAllWs = !/[^\s]/.test(node.nodeValue); | ||
// A comment node or a text node, all whitespace | ||
const isIgnorable = | ||
@@ -77,0 +77,0 @@ node.nodeType == 8 || (node.nodeType == 3 && isAllWs); |
{ | ||
"name": "pseudo-localization", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Dynamic pseudo-localization in the browser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,8 +1,14 @@ | ||
<sub>Inspired by https://medium.com/netflix-techblog/pseudo-localization-netflix-12fff76fbcbe</sub> | ||
# pseudo-localization | ||
Inspired by https://medium.com/netflix-techblog/pseudo-localization-netflix-12fff76fbcbe | ||
| English | Pseudo Language | | ||
| ------------- | ------------- | | ||
| <img width="559" alt="screen shot 2018-08-12 at 1 23 18 pm" src="https://user-images.githubusercontent.com/2373958/44001651-21f32b42-9e36-11e8-80eb-5b88e8fd9b13.png"> | <img width="661" alt="after" src="https://user-images.githubusercontent.com/2373958/44001656-2fba7780-9e36-11e8-8924-69c849a3b48c.png"> | | ||
--- | ||
`pseudo-localization` is a script that performs [pseudolocalization](https://en.wikipedia.org/wiki/Pseudolocalization) agains the DOM. | ||
[Demo here](https://tryggvigy.github.io/pseudo-localization/hamlet.html). Changing text in text nodes, adding or removing trees of elements will all trigger a pseudolocalization run on all the new text added to the dom. You can try it using the devtools. | ||
[Demo here](https://tryggvigy.github.io/pseudo-localization/hamlet.html). Changing text nodes and adding or removing trees of elements will trigger a pseudolocalization run on all the new text added to the DOM. Try it using the devtools. | ||
@@ -72,6 +78,4 @@ ## Installation | ||
Below you can see vertical cutoff, caught by psuedolocalization in action. | ||
| English | Pseudo Language | | ||
| ------------- | ------------- | | ||
| <img width="559" alt="screen shot 2018-08-12 at 1 23 18 pm" src="https://user-images.githubusercontent.com/2373958/44001651-21f32b42-9e36-11e8-80eb-5b88e8fd9b13.png"> | <img width="661" alt="after" src="https://user-images.githubusercontent.com/2373958/44001656-2fba7780-9e36-11e8-8924-69c849a3b48c.png"> | | ||
## Support | ||
Works in all evergreen browsers. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81
385106