diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-27 19:16:29 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-27 19:16:29 +0800 |
commit | e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6 (patch) | |
tree | c323e12dceb35506b9c037cc8afcdb8ea504ed77 | |
parent | e718123478fef5d7959936d0667b68ee7507755d (diff) | |
download | dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.gz dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.bz2 dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.lz dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.xz dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.tar.zst dexon-sol-tools-e10561b4a5b06983ac8a3a2f0f923f7eeeaa9bb6.zip |
Fix translation capitalizations to not capitalize single letters with sentences (i.e 'a' in 'Build a Relayer')
-rw-r--r-- | packages/website/ts/utils/translate.ts | 7 |
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; |