pseudo-localization icon indicating copy to clipboard operation
pseudo-localization copied to clipboard

[Request] Option to increase output size.

Open tabarra opened this issue 3 years ago • 2 comments

Duplicating vowels is good, but some locales are REALLY verbose, I would like an option to 3x or maybe even 4x any vowels.

tabarra avatar Aug 28 '22 15:08 tabarra

If you want, I can PR it, sounds easy enough to just replace the line below with opts.map[char].repeat(elongateLength) or something. https://github.com/tryggvigy/pseudo-localization/blob/2b952f0d09414c5dbea6a562b543d98c61bd28c1/src/localize.ts#L149

Just let me know how you want this to be reflected in the package options.

tabarra avatar Aug 29 '22 09:08 tabarra

Hey @tabarra! Sorry for the slow reply. I think this is reasonable to add :) Perhaps repeatCommonVowelsTimes is more descriptive? I think this option could replace the elongate boolean option. repeatCommonVowelsTimes: 0 would result in the same behavior as elongate: false

We can default repeatCommonVowelsTimes = 1 Probably would be good to add a jsdoc comment explaining what this option does so folks can see that through the language server, for example when hovering over the option in VSCode. Something like

/**
 * The number of times "a", "e" "o", and "u" should be repeated.
 * Default to `1` which results in ~30% longer English text.
 */
repeatCommonVowelsTimes = 1

Feel free to make a PR if you want! Otherwise, I'll get around to making this improvement eventually. I can't promise it will be soon though since I don't have a lot of time for open-source these days :)

tryggvigy avatar Sep 12 '22 15:09 tryggvigy