From f5dcd81c40cf99ec95d688bf298334403e1bc42f Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Wed, 19 Jun 2019 15:22:08 +0800 Subject: [PATCH] feat(module:typography): support i18n --- components/core/util/style-checke.ts | 8 +++ components/i18n/languages/en_US.ts | 9 +++ components/i18n/languages/es_ES.ts | 9 +++ components/i18n/languages/it_IT.ts | 6 ++ components/i18n/languages/ru_RU.ts | 9 +++ components/i18n/languages/tr_TR.ts | 6 ++ components/i18n/languages/zh_CN.ts | 9 +++ components/i18n/languages/zh_TW.ts | 3 + components/input/nz-autosize.directive.ts | 2 +- .../typography/nz-text-copy.component.html | 2 +- .../typography/nz-text-copy.component.ts | 21 ++++++- .../typography/nz-text-edit.component.html | 2 +- .../typography/nz-text-edit.component.ts | 28 +++++++-- .../typography/nz-typography.component.html | 8 +-- .../typography/nz-typography.component.ts | 62 ++++++++++++------- components/typography/nz-typography.module.ts | 3 +- components/typography/style/index.less | 36 +++-------- 17 files changed, 156 insertions(+), 67 deletions(-) diff --git a/components/core/util/style-checke.ts b/components/core/util/style-checke.ts index 98bed55fffc..30ed9148f33 100644 --- a/components/core/util/style-checke.ts +++ b/components/core/util/style-checke.ts @@ -1,3 +1,11 @@ +/** + * @license + * Copyright Alibaba.com All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE + */ + export function isStyleSupport(styleName: string | string[]): boolean { if (typeof window !== 'undefined' && window.document && window.document.documentElement) { const styleNameList = Array.isArray(styleName) ? styleName : [styleName]; diff --git a/components/i18n/languages/en_US.ts b/components/i18n/languages/en_US.ts index 02cae05b950..2e487c393f4 100644 --- a/components/i18n/languages/en_US.ts +++ b/components/i18n/languages/en_US.ts @@ -51,5 +51,14 @@ export default { }, Empty: { description: 'No Data' + }, + Text: { + edit: 'edit', + copy: 'copy', + copied: 'copy success', + expand: 'expand' + }, + PageHeader: { + back: 'back' } }; diff --git a/components/i18n/languages/es_ES.ts b/components/i18n/languages/es_ES.ts index 5b18a37398e..17b8dc6bd4d 100644 --- a/components/i18n/languages/es_ES.ts +++ b/components/i18n/languages/es_ES.ts @@ -46,5 +46,14 @@ export default { }, Empty: { description: 'No hay datos' + }, + Text: { + edit: 'editar', + copy: 'copiar', + copied: 'copiado', + expand: 'expandir' + }, + PageHeader: { + back: 'volver' } }; diff --git a/components/i18n/languages/it_IT.ts b/components/i18n/languages/it_IT.ts index 7a7a563d28f..3ed116ec6b8 100644 --- a/components/i18n/languages/it_IT.ts +++ b/components/i18n/languages/it_IT.ts @@ -47,5 +47,11 @@ export default { }, Empty: { description: 'Nessun dato' + }, + Text: { + edit: 'modifica', + copy: 'copia', + copied: 'copia effettuata', + expand: 'espandi' } }; diff --git a/components/i18n/languages/ru_RU.ts b/components/i18n/languages/ru_RU.ts index 801441a795e..cf14713b140 100644 --- a/components/i18n/languages/ru_RU.ts +++ b/components/i18n/languages/ru_RU.ts @@ -46,5 +46,14 @@ export default { }, Empty: { description: 'Нет данных' + }, + Text: { + edit: 'редактировать', + copy: 'копировать', + copied: 'скопировано', + expand: 'раскрыть' + }, + PageHeader: { + back: 'назад' } }; diff --git a/components/i18n/languages/tr_TR.ts b/components/i18n/languages/tr_TR.ts index c9caa1e6f93..c761c0e065b 100644 --- a/components/i18n/languages/tr_TR.ts +++ b/components/i18n/languages/tr_TR.ts @@ -46,5 +46,11 @@ export default { }, Empty: { description: 'Veri Yok' + }, + Text: { + edit: 'düzenle', + copy: 'kopyala', + copied: 'kopyalandı', + expand: 'genişlet' } }; diff --git a/components/i18n/languages/zh_CN.ts b/components/i18n/languages/zh_CN.ts index 409c6a44f86..f4d5ede807c 100644 --- a/components/i18n/languages/zh_CN.ts +++ b/components/i18n/languages/zh_CN.ts @@ -51,5 +51,14 @@ export default { }, Empty: { description: '暂无数据' + }, + Text: { + edit: '编辑', + copy: '复制', + copied: '复制成功', + expand: '展开' + }, + PageHeader: { + back: '返回' } }; diff --git a/components/i18n/languages/zh_TW.ts b/components/i18n/languages/zh_TW.ts index 1199cf2da75..0b6b15b9fa6 100644 --- a/components/i18n/languages/zh_TW.ts +++ b/components/i18n/languages/zh_TW.ts @@ -46,5 +46,8 @@ export default { }, Empty: { description: '無此資料' + }, + PageHeader: { + back: '返回' } }; diff --git a/components/input/nz-autosize.directive.ts b/components/input/nz-autosize.directive.ts index 321fa6a9f2b..5eda45a6bbc 100644 --- a/components/input/nz-autosize.directive.ts +++ b/components/input/nz-autosize.directive.ts @@ -144,7 +144,7 @@ export class NzAutosizeDirective implements AfterViewInit, OnDestroy, DoCheck { textareaClone.style.overflow = 'hidden'; this.el.parentNode!.appendChild(textareaClone); - this.cachedLineHeight = textareaClone.clientHeight - this.inputGap - 1; + this.cachedLineHeight = textareaClone.clientHeight; this.el.parentNode!.removeChild(textareaClone); // Min and max heights have to be re-calculated if the cached line height changes diff --git a/components/typography/nz-text-copy.component.html b/components/typography/nz-text-copy.component.html index 6b05dadf8b1..c1271075354 100644 --- a/components/typography/nz-text-copy.component.html +++ b/components/typography/nz-text-copy.component.html @@ -1,4 +1,4 @@ - +