aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-27 19:16:29 +0800
committerFabio Berger <me@fabioberger.com>2018-08-27 19:16:29 +0800
commite10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6 (patch)
treec323e12dceb35506b9c037cc8afcdb8ea504ed77 /packages/website/ts/utils
parente718123478fef5d7959936d0667b68ee7507755d (diff)
downloaddexon-0x-contracts-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.gz
dexon-0x-contracts-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.zst
dexon-0x-contracts-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.zip
Fix translation capitalizations to not capitalize single letters with sentences (i.e 'a' in 'Build a Relayer')
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/translate.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/website/ts/utils/translate.ts b/packages/website/ts/utils/translate.ts
index 1ee1a59c5..5595e6e0f 100644
--- a/packages/website/ts/utils/translate.ts
+++ b/packages/website/ts/utils/translate.ts
@@ -80,7 +80,12 @@ export class Translate {
case Deco.CapWords:
const words = text.split(' ');
- const capitalizedWords = _.map(words, w => this._capitalize(w));
+ const capitalizedWords = _.map(words, (w: string, i: number) => {
+ if (w.length === 1) {
+ return w;
+ }
+ return this._capitalize(w);
+ });
text = capitalizedWords.join(' ');
break;