@refinitiv-ui/phrasebook 5.1.3 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/locale/de/color-dialog.d.ts +8 -0
- package/lib/locale/de/color-dialog.js +11 -0
- package/lib/locale/de/combo-box.d.ts +6 -0
- package/lib/locale/de/combo-box.js +8 -0
- package/lib/locale/de/dialog.d.ts +5 -0
- package/lib/locale/de/dialog.js +8 -0
- package/lib/locale/de/pagination.d.ts +6 -0
- package/lib/locale/de/pagination.js +20 -0
- package/lib/locale/de/password-field.d.ts +5 -0
- package/lib/locale/de/password-field.js +7 -0
- package/lib/locale/de/search-field.d.ts +4 -0
- package/lib/locale/de/search-field.js +6 -0
- package/lib/locale/de/shared.d.ts +7 -0
- package/lib/locale/de/shared.js +10 -0
- package/lib/locale/de/tree-select.d.ts +13 -0
- package/lib/locale/de/tree-select.js +13 -0
- package/lib/locale/en/color-dialog.d.ts +8 -0
- package/lib/locale/en/color-dialog.js +11 -0
- package/lib/locale/en/combo-box.d.ts +6 -0
- package/lib/locale/en/combo-box.js +8 -0
- package/lib/locale/en/dialog.d.ts +5 -0
- package/lib/locale/en/dialog.js +7 -0
- package/lib/locale/en/pagination.d.ts +6 -0
- package/lib/locale/en/pagination.js +20 -0
- package/lib/locale/en/password-field.d.ts +5 -0
- package/lib/locale/en/password-field.js +7 -0
- package/lib/locale/en/search-field.d.ts +4 -0
- package/lib/locale/en/search-field.js +6 -0
- package/lib/locale/en/shared.d.ts +7 -0
- package/lib/locale/en/shared.js +10 -0
- package/lib/locale/en/tree-select.d.ts +13 -0
- package/lib/locale/en/tree-select.js +13 -0
- package/lib/locale/ja/color-dialog.d.ts +8 -0
- package/lib/locale/ja/color-dialog.js +11 -0
- package/lib/locale/ja/combo-box.d.ts +6 -0
- package/lib/locale/ja/combo-box.js +8 -0
- package/lib/locale/ja/dialog.d.ts +5 -0
- package/lib/locale/ja/dialog.js +8 -0
- package/lib/locale/ja/pagination.d.ts +6 -0
- package/lib/locale/ja/pagination.js +20 -0
- package/lib/locale/ja/password-field.d.ts +5 -0
- package/lib/locale/ja/password-field.js +7 -0
- package/lib/locale/ja/search-field.d.ts +4 -0
- package/lib/locale/ja/search-field.js +6 -0
- package/lib/locale/ja/shared.d.ts +7 -0
- package/lib/locale/ja/shared.js +10 -0
- package/lib/locale/ja/tree-select.d.ts +13 -0
- package/lib/locale/ja/tree-select.js +13 -0
- package/lib/locale/zh/color-dialog.d.ts +8 -0
- package/lib/locale/zh/color-dialog.js +11 -0
- package/lib/locale/zh/combo-box.d.ts +6 -0
- package/lib/locale/zh/combo-box.js +8 -0
- package/lib/locale/zh/dialog.d.ts +5 -0
- package/lib/locale/zh/dialog.js +8 -0
- package/lib/locale/zh/pagination.d.ts +6 -0
- package/lib/locale/zh/pagination.js +20 -0
- package/lib/locale/zh/password-field.d.ts +5 -0
- package/lib/locale/zh/password-field.js +7 -0
- package/lib/locale/zh/search-field.d.ts +4 -0
- package/lib/locale/zh/search-field.js +6 -0
- package/lib/locale/zh/shared.d.ts +7 -0
- package/lib/locale/zh/shared.js +10 -0
- package/lib/locale/zh/tree-select.d.ts +13 -0
- package/lib/locale/zh/tree-select.js +13 -0
- package/lib/locale/zh-hant/color-dialog.d.ts +8 -0
- package/lib/locale/zh-hant/color-dialog.js +11 -0
- package/lib/locale/zh-hant/combo-box.d.ts +6 -0
- package/lib/locale/zh-hant/combo-box.js +8 -0
- package/lib/locale/zh-hant/dialog.d.ts +5 -0
- package/lib/locale/zh-hant/dialog.js +8 -0
- package/lib/locale/zh-hant/pagination.d.ts +6 -0
- package/lib/locale/zh-hant/pagination.js +20 -0
- package/lib/locale/zh-hant/password-field.d.ts +5 -0
- package/lib/locale/zh-hant/password-field.js +7 -0
- package/lib/locale/zh-hant/search-field.d.ts +4 -0
- package/lib/locale/zh-hant/search-field.js +6 -0
- package/lib/locale/zh-hant/shared.d.ts +7 -0
- package/lib/locale/zh-hant/shared.js +10 -0
- package/lib/locale/zh-hant/tree-select.d.ts +13 -0
- package/lib/locale/zh-hant/tree-select.js +13 -0
- package/lib/translation.d.ts +52 -0
- package/lib/translation.js +84 -0
- package/lib/types.d.ts +4 -0
- package/lib/types.js +1 -0
- package/package.json +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,37 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.2.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/phrasebook@5.2.0...@refinitiv-ui/phrasebook@5.2.1) (2021-12-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **phrasebook:** change ICU syntax on Japanese language ([9b235ab](https://github.com/Refinitiv/refinitiv-ui/commit/9b235ab61fa0dae5c6ce97b66acee52dfd4028d4))
|
|
12
|
+
* **phrasebook:** export path should go to lib folder ([681028f](https://github.com/Refinitiv/refinitiv-ui/commit/681028ff960a831cfa888d0fdea38ddd40de815f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [5.2.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/phrasebook@5.1.6...@refinitiv-ui/phrasebook@5.2.0) (2021-11-08)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* Lit@2 upgrade ([dbda63b](https://github.com/Refinitiv/refinitiv-ui/commit/dbda63be97257f891cb1f2c5ff46b638c70e0b15))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [5.1.6](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/phrasebook@5.1.3...@refinitiv-ui/phrasebook@5.1.6) (2021-10-25)
|
|
30
|
+
|
|
31
|
+
**Note:** Version bump only for package @refinitiv-ui/phrasebook
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
6
37
|
## [5.1.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/phrasebook@5.1.2...@refinitiv-ui/phrasebook@5.1.3) (2021-10-11)
|
|
7
38
|
|
|
8
39
|
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Phrasebook, ObserverKey } from './translation.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/color-dialog.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import dialogTranslations from './dialog';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, dialogTranslations), {
|
|
6
|
+
// Dialog title
|
|
7
|
+
HEADER: 'Farbauswahl',
|
|
8
|
+
// Color values for color mixer, has space for a single character
|
|
9
|
+
RED: 'R', GREEN: 'G', BLUE: 'B' });
|
|
10
|
+
Phrasebook.define('de', 'ef-color-dialog', translations);
|
|
11
|
+
export default translations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/pagination.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
const translations = {
|
|
5
|
+
// page: current page #
|
|
6
|
+
// pageTotal: total number of pages
|
|
7
|
+
PAGE_OF: 'Seite {page} von {pageTotal}',
|
|
8
|
+
/*
|
|
9
|
+
* totalCount: total number of items
|
|
10
|
+
* pageSize: Number of items per page
|
|
11
|
+
* ** To translate
|
|
12
|
+
* No items
|
|
13
|
+
* of = eg page 1 of 2
|
|
14
|
+
* item
|
|
15
|
+
* items
|
|
16
|
+
*/
|
|
17
|
+
ITEM_INFO: '{totalCount, plural, =0 {Keine Elemente} other {{ totalCount, plural, other { {pageSize, plural, =1 {#} other {{from} - {to}}} von {totalCount} {totalCount, plural, =1 {item} other {items}}} }} }'
|
|
18
|
+
};
|
|
19
|
+
Phrasebook.define('de', 'ef-pagination', translations);
|
|
20
|
+
export default translations;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Phrasebook } from '../../translation.js';
|
|
2
|
+
// these are used for buttons
|
|
3
|
+
const translations = {
|
|
4
|
+
CANCEL: 'Abbrechen',
|
|
5
|
+
OK: 'OK',
|
|
6
|
+
CLOSE: 'Schließen',
|
|
7
|
+
APPLY: 'Anwenden'
|
|
8
|
+
};
|
|
9
|
+
Phrasebook.define('de', translations);
|
|
10
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './shared.js';
|
|
2
|
+
declare const translations: {
|
|
3
|
+
FULL_LIST: string;
|
|
4
|
+
SELECTED: string;
|
|
5
|
+
EXPAND_COLLAPSE: string;
|
|
6
|
+
SELECT_CONTROL: string;
|
|
7
|
+
DONE: string;
|
|
8
|
+
SELECTED_NUM: string;
|
|
9
|
+
MATCHES_NUM: string;
|
|
10
|
+
MULTIPLE_ITEMS: string;
|
|
11
|
+
NO_OPTIONS: string;
|
|
12
|
+
};
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/tree-select.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import comboboxTranslations from './combo-box';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, comboboxTranslations), {
|
|
6
|
+
// used as a toggle control
|
|
7
|
+
FULL_LIST: 'Vollständige Liste', SELECTED: 'Ausgewählt', EXPAND_COLLAPSE: '{expansion, select, true {Alle einklappen} other {Alle ausklappen}}', SELECT_CONTROL: '{selected, select, true {Auswahl aufheben} other {Alle auswählen}}',
|
|
8
|
+
// button control
|
|
9
|
+
DONE: 'Fertig',
|
|
10
|
+
// selection/filter feedback
|
|
11
|
+
SELECTED_NUM: '{numSelected, plural, =0 {} =1 {Eine Auswahl.} other {# ausgewählt.}}', MATCHES_NUM: '{numMatched, plural, =0 {Keine Ergebnisse} =1 {1 Ergebnis} other {# Ergebnisse}}' });
|
|
12
|
+
Phrasebook.define('de', 'ef-tree-select', translations);
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/color-dialog.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import dialogTranslations from './dialog';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, dialogTranslations), {
|
|
6
|
+
// Dialog title
|
|
7
|
+
HEADER: 'Color Picker',
|
|
8
|
+
// Color values for color mixer, has space for a single character
|
|
9
|
+
RED: 'R', GREEN: 'G', BLUE: 'B' });
|
|
10
|
+
Phrasebook.define('en', 'ef-color-dialog', translations);
|
|
11
|
+
export default translations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/pagination.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
const translations = {
|
|
5
|
+
// page: current page #
|
|
6
|
+
// pageTotal: total number of pages
|
|
7
|
+
PAGE_OF: 'Page {page} of {pageTotal}',
|
|
8
|
+
/*
|
|
9
|
+
* totalCount: total number of items
|
|
10
|
+
* pageSize: Number of items per page
|
|
11
|
+
* ** To translate
|
|
12
|
+
* No items
|
|
13
|
+
* of = eg page 1 of 2
|
|
14
|
+
* item
|
|
15
|
+
* items
|
|
16
|
+
*/
|
|
17
|
+
ITEM_INFO: '{totalCount, plural, =0 {No Items} other {{ totalCount, plural, other { {pageSize, plural, =1 {#} other {{from} - {to}}} of {totalCount} {totalCount, plural, =1 {item} other {items}}} }} }'
|
|
18
|
+
};
|
|
19
|
+
Phrasebook.define('en', 'ef-pagination', translations);
|
|
20
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './shared.js';
|
|
2
|
+
declare const translations: {
|
|
3
|
+
FULL_LIST: string;
|
|
4
|
+
SELECTED: string;
|
|
5
|
+
EXPAND_COLLAPSE: string;
|
|
6
|
+
SELECT_CONTROL: string;
|
|
7
|
+
DONE: string;
|
|
8
|
+
SELECTED_NUM: string;
|
|
9
|
+
MATCHES_NUM: string;
|
|
10
|
+
MULTIPLE_ITEMS: string;
|
|
11
|
+
NO_OPTIONS: string;
|
|
12
|
+
};
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/tree-select.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import comboboxTranslations from './combo-box';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, comboboxTranslations), {
|
|
6
|
+
// used as a toggle control
|
|
7
|
+
FULL_LIST: 'Full List', SELECTED: 'Selected', EXPAND_COLLAPSE: '{expansion, select, true {Collapse All} other {Expand All}}', SELECT_CONTROL: '{selected, select, true {Deselect All} other {Select All}}',
|
|
8
|
+
// button control
|
|
9
|
+
DONE: 'Done',
|
|
10
|
+
// selection/filter feedback
|
|
11
|
+
SELECTED_NUM: '{numSelected, plural, =0 {} =1 {One Selected.} other {# Selected.}}', MATCHES_NUM: '{numMatched, plural, =0 {No results found.} =1 {1 result found.} other {# results found.}}' });
|
|
12
|
+
Phrasebook.define('en', 'ef-tree-select', translations);
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/color-dialog.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import dialogTranslations from './dialog';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, dialogTranslations), {
|
|
6
|
+
// Dialog title
|
|
7
|
+
HEADER: '色を選択',
|
|
8
|
+
// Color values for color mixer, has space for a single character
|
|
9
|
+
RED: 'R', GREEN: 'G', BLUE: 'B' });
|
|
10
|
+
Phrasebook.define('ja', 'ef-color-dialog', translations);
|
|
11
|
+
export default translations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/pagination.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
const translations = {
|
|
5
|
+
// page: current page #
|
|
6
|
+
// pageTotal: total number of pages
|
|
7
|
+
PAGE_OF: '{pageTotal} ページ中 {page} ページ目 ',
|
|
8
|
+
/*
|
|
9
|
+
* totalCount: total number of items
|
|
10
|
+
* pageSize: Number of items per page
|
|
11
|
+
* ** To translate
|
|
12
|
+
* No items
|
|
13
|
+
* of = eg page 1 of 2
|
|
14
|
+
* item
|
|
15
|
+
* items
|
|
16
|
+
*/
|
|
17
|
+
ITEM_INFO: '{totalCount, plural, =0 {該当なし} other {{ totalCount, plural, other { {totalCount} {totalCount, plural, =1 { 件} other { 件}}中 {pageSize, plural, =1 {#} other {{from} - {to}}} 件目 } }} }'
|
|
18
|
+
};
|
|
19
|
+
Phrasebook.define('ja', 'ef-pagination', translations);
|
|
20
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './shared.js';
|
|
2
|
+
declare const translations: {
|
|
3
|
+
FULL_LIST: string;
|
|
4
|
+
SELECTED: string;
|
|
5
|
+
EXPAND_COLLAPSE: string;
|
|
6
|
+
SELECT_CONTROL: string;
|
|
7
|
+
DONE: string;
|
|
8
|
+
SELECTED_NUM: string;
|
|
9
|
+
MATCHES_NUM: string;
|
|
10
|
+
MULTIPLE_ITEMS: string;
|
|
11
|
+
NO_OPTIONS: string;
|
|
12
|
+
};
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/tree-select.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import comboboxTranslations from './combo-box';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, comboboxTranslations), {
|
|
6
|
+
// used as a toggle control
|
|
7
|
+
FULL_LIST: 'すべて', SELECTED: '選択項目のみ', EXPAND_COLLAPSE: '{expansion, select, false {すべてを展開} other {すべてを折りたたむ}}', SELECT_CONTROL: '{selected, select, false {すべて選択} other {選択をすべて解除}}',
|
|
8
|
+
// button control
|
|
9
|
+
DONE: '完了',
|
|
10
|
+
// selection/filter feedback
|
|
11
|
+
SELECTED_NUM: '{numSelected, plural, =0 {} =1 {1 件選択済み} other {# 件選択済み}}', MATCHES_NUM: '{numMatched, plural, =0 {該当項目はありません} =1 {検索結果 – 1件} other {検索結果 – #件}}' });
|
|
12
|
+
Phrasebook.define('ja', 'ef-tree-select', translations);
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/color-dialog.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import dialogTranslations from './dialog';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, dialogTranslations), {
|
|
6
|
+
// Dialog title
|
|
7
|
+
HEADER: '颜色选择',
|
|
8
|
+
// Color values for color mixer, has space for a single character
|
|
9
|
+
RED: 'R', GREEN: 'G', BLUE: 'B' });
|
|
10
|
+
Phrasebook.define('zh', 'ef-color-dialog', translations);
|
|
11
|
+
export default translations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/pagination.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
const translations = {
|
|
5
|
+
// page: current page #
|
|
6
|
+
// pageTotal: total number of pages
|
|
7
|
+
PAGE_OF: '第 {page}/{pageTotal} 页',
|
|
8
|
+
/*
|
|
9
|
+
* totalCount: total number of items
|
|
10
|
+
* pageSize: Number of items per page
|
|
11
|
+
* ** To translate
|
|
12
|
+
* No items
|
|
13
|
+
* of = eg page 1 of 2
|
|
14
|
+
* item
|
|
15
|
+
* items
|
|
16
|
+
*/
|
|
17
|
+
ITEM_INFO: '{totalCount, plural, =0 {无项目。} other {{ totalCount, plural, other { {pageSize, plural, =1 {#} other {{from} - {to}}} 项,共 {totalCount} {totalCount, plural, =1 {项} other {项}}} }} }'
|
|
18
|
+
};
|
|
19
|
+
Phrasebook.define('zh', 'ef-pagination', translations);
|
|
20
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './shared.js';
|
|
2
|
+
declare const translations: {
|
|
3
|
+
FULL_LIST: string;
|
|
4
|
+
SELECTED: string;
|
|
5
|
+
EXPAND_COLLAPSE: string;
|
|
6
|
+
SELECT_CONTROL: string;
|
|
7
|
+
DONE: string;
|
|
8
|
+
SELECTED_NUM: string;
|
|
9
|
+
MATCHES_NUM: string;
|
|
10
|
+
MULTIPLE_ITEMS: string;
|
|
11
|
+
NO_OPTIONS: string;
|
|
12
|
+
};
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/tree-select.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import comboboxTranslations from './combo-box';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, comboboxTranslations), {
|
|
6
|
+
// used as a toggle control
|
|
7
|
+
FULL_LIST: '全部列表', SELECTED: '已选项列表', EXPAND_COLLAPSE: '{expansion, select, true {全部收起} other {全部展开}}', SELECT_CONTROL: '{selected, select, true {取消全选} other {全选}}',
|
|
8
|
+
// button control
|
|
9
|
+
DONE: '完成',
|
|
10
|
+
// selection/filter feedback
|
|
11
|
+
SELECTED_NUM: '{numSelected, plural, =0 {} =1 {已选 1 项。} other {已选 # 项。}}', MATCHES_NUM: '{numMatched, plural, =0 {未找到结果。} =1 {找到了 1 个结果。} other {找到了 # 个结果。}}' });
|
|
12
|
+
Phrasebook.define('zh', 'ef-tree-select', translations);
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/color-dialog.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import dialogTranslations from './dialog';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, dialogTranslations), {
|
|
6
|
+
// Dialog title
|
|
7
|
+
HEADER: '顏色選擇',
|
|
8
|
+
// Color values for color mixer, has space for a single character
|
|
9
|
+
RED: 'R', GREEN: 'G', BLUE: 'B' });
|
|
10
|
+
Phrasebook.define('zh-Hant', 'ef-color-dialog', translations);
|
|
11
|
+
export default translations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/pagination.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
const translations = {
|
|
5
|
+
// page: current page #
|
|
6
|
+
// pageTotal: total number of pages
|
|
7
|
+
PAGE_OF: '第 {page}頁/共{pageTotal} 頁',
|
|
8
|
+
/*
|
|
9
|
+
* totalCount: total number of items
|
|
10
|
+
* pageSize: Number of items per page
|
|
11
|
+
* ** To translate
|
|
12
|
+
* No items
|
|
13
|
+
* of = eg page 1 of 2
|
|
14
|
+
* item
|
|
15
|
+
* items
|
|
16
|
+
*/
|
|
17
|
+
ITEM_INFO: '{totalCount, plural, =0 {無項目} other {{ totalCount, plural, other { {pageSize, plural, =1 {#} other {{from} - {to}}} 項,共 {totalCount} {totalCount, plural, =1 {項} other {項}}} }} }'
|
|
18
|
+
};
|
|
19
|
+
Phrasebook.define('zh-Hant', 'ef-pagination', translations);
|
|
20
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './shared.js';
|
|
2
|
+
declare const translations: {
|
|
3
|
+
FULL_LIST: string;
|
|
4
|
+
SELECTED: string;
|
|
5
|
+
EXPAND_COLLAPSE: string;
|
|
6
|
+
SELECT_CONTROL: string;
|
|
7
|
+
DONE: string;
|
|
8
|
+
SELECTED_NUM: string;
|
|
9
|
+
MATCHES_NUM: string;
|
|
10
|
+
MULTIPLE_ITEMS: string;
|
|
11
|
+
NO_OPTIONS: string;
|
|
12
|
+
};
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Component docs https://elf.int.refinitiv.com/elements/tree-select.html
|
|
2
|
+
import { Phrasebook } from '../../translation.js';
|
|
3
|
+
import './shared.js';
|
|
4
|
+
import comboboxTranslations from './combo-box';
|
|
5
|
+
const translations = Object.assign(Object.assign({}, comboboxTranslations), {
|
|
6
|
+
// used as a toggle control
|
|
7
|
+
FULL_LIST: '完整列表', SELECTED: '已選項列表', EXPAND_COLLAPSE: '{expansion, select, true {全部收起} other {全部展開}}', SELECT_CONTROL: '{selected, select, true {取消全選} other {全選}}',
|
|
8
|
+
// button control
|
|
9
|
+
DONE: '完成',
|
|
10
|
+
// selection/filter feedback
|
|
11
|
+
SELECTED_NUM: '{numSelected, plural, =0 {} =1 {已選 1 項。} other {已選 # 項。}}', MATCHES_NUM: '{numMatched, plural, =0 {未找到結果。} =1 {找到了 1 個結果。} other {找到了 # 個結果。}}' });
|
|
12
|
+
Phrasebook.define('zh-Hant', 'ef-tree-select', translations);
|
|
13
|
+
export default translations;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Translations } from './types';
|
|
2
|
+
declare class ObserverKey {
|
|
3
|
+
}
|
|
4
|
+
declare type ObserverCallback = (locale: string) => void;
|
|
5
|
+
declare abstract class Phrasebook {
|
|
6
|
+
private static localeMap;
|
|
7
|
+
private static observables;
|
|
8
|
+
private static publish;
|
|
9
|
+
/**
|
|
10
|
+
* Start observing changes to translations
|
|
11
|
+
* @param scope The scope to observe
|
|
12
|
+
* @param callback A callback run when the scope has changed
|
|
13
|
+
* @returns An observe key used to disconnet
|
|
14
|
+
*/
|
|
15
|
+
static observe(scope: string, callback: ObserverCallback): ObserverKey;
|
|
16
|
+
/**
|
|
17
|
+
* Stop observing and disconnect a callback
|
|
18
|
+
* @param key A key to stop observing the scope
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
static disconnect(key: ObserverKey): void;
|
|
22
|
+
/**
|
|
23
|
+
* Define shared scope translations.
|
|
24
|
+
* Shared scope are available globally across all translation keys.
|
|
25
|
+
* @param locale Locale
|
|
26
|
+
* @param translations Translations
|
|
27
|
+
* @returns {void}
|
|
28
|
+
*/
|
|
29
|
+
static define(locale: string, translations: Translations): void;
|
|
30
|
+
/**
|
|
31
|
+
* Define scoped translations.
|
|
32
|
+
* @param locale Locale
|
|
33
|
+
* @param scope Scope
|
|
34
|
+
* @param translations Translations
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
static define(locale: string, scope: string, translations: Translations): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get translation for locale and scope.
|
|
40
|
+
* @param locale Locale to get
|
|
41
|
+
* @param scope Scope to get
|
|
42
|
+
* @returns translation or null
|
|
43
|
+
*/
|
|
44
|
+
static get(locale: string, scope: string): null | Translations;
|
|
45
|
+
/**
|
|
46
|
+
* Get a list of supported locales per scope
|
|
47
|
+
* @param [scope=SHARED_SCOPE] A scope to check. If none provided a shared scope is returned
|
|
48
|
+
* @returns list of supported locales
|
|
49
|
+
*/
|
|
50
|
+
static supported(scope?: string): string[];
|
|
51
|
+
}
|
|
52
|
+
export { ObserverKey, ObserverCallback, Phrasebook };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const SHARED_SCOPE = '__shared__'; /* unique scope identifier */
|
|
2
|
+
class ObserverKey {
|
|
3
|
+
}
|
|
4
|
+
class Phrasebook {
|
|
5
|
+
static publish(publishLocale, publishScope) {
|
|
6
|
+
const callbackFn = (observable) => {
|
|
7
|
+
const { callback, scope } = observable;
|
|
8
|
+
// for shared scope all observed must be updated
|
|
9
|
+
if (publishScope === SHARED_SCOPE || publishScope === scope) {
|
|
10
|
+
callback(publishLocale);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
this.observables.forEach(callbackFn);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Start observing changes to translations
|
|
17
|
+
* @param scope The scope to observe
|
|
18
|
+
* @param callback A callback run when the scope has changed
|
|
19
|
+
* @returns An observe key used to disconnet
|
|
20
|
+
*/
|
|
21
|
+
static observe(scope, callback) {
|
|
22
|
+
const key = new ObserverKey();
|
|
23
|
+
this.observables.set(key, {
|
|
24
|
+
scope,
|
|
25
|
+
callback
|
|
26
|
+
});
|
|
27
|
+
return key;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Stop observing and disconnect a callback
|
|
31
|
+
* @param key A key to stop observing the scope
|
|
32
|
+
* @returns {void}
|
|
33
|
+
*/
|
|
34
|
+
static disconnect(key) {
|
|
35
|
+
this.observables.delete(key);
|
|
36
|
+
}
|
|
37
|
+
static define(locale, scope, translations = scope) {
|
|
38
|
+
if (scope === SHARED_SCOPE) {
|
|
39
|
+
throw new Error(`${SHARED_SCOPE} scope name is reserved`);
|
|
40
|
+
}
|
|
41
|
+
if (!locale || !scope || !translations) {
|
|
42
|
+
throw new Error('Translations must define locale, scope and translations collection');
|
|
43
|
+
}
|
|
44
|
+
scope = typeof scope !== 'string' ? SHARED_SCOPE : scope;
|
|
45
|
+
const translationMap = this.localeMap[locale] || {};
|
|
46
|
+
translationMap[scope] = translations;
|
|
47
|
+
this.localeMap[locale] = translationMap;
|
|
48
|
+
this.publish(locale, scope);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get translation for locale and scope.
|
|
52
|
+
* @param locale Locale to get
|
|
53
|
+
* @param scope Scope to get
|
|
54
|
+
* @returns translation or null
|
|
55
|
+
*/
|
|
56
|
+
static get(locale, scope) {
|
|
57
|
+
const translationsMap = this.localeMap[locale];
|
|
58
|
+
if (!translationsMap) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return Object.assign({}, translationsMap[SHARED_SCOPE] || {}, translationsMap[scope] || {});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get a list of supported locales per scope
|
|
65
|
+
* @param [scope=SHARED_SCOPE] A scope to check. If none provided a shared scope is returned
|
|
66
|
+
* @returns list of supported locales
|
|
67
|
+
*/
|
|
68
|
+
static supported(scope = SHARED_SCOPE) {
|
|
69
|
+
const locales = [];
|
|
70
|
+
const localeMap = this.localeMap;
|
|
71
|
+
let translation;
|
|
72
|
+
let locale;
|
|
73
|
+
for (locale in localeMap) {
|
|
74
|
+
translation = localeMap[locale];
|
|
75
|
+
if (translation[scope]) {
|
|
76
|
+
locales.push(locale);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return locales;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
Phrasebook.localeMap = {};
|
|
83
|
+
Phrasebook.observables = new Map();
|
|
84
|
+
export { ObserverKey, Phrasebook };
|
package/lib/types.d.ts
ADDED
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/phrasebook",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Collection of messages in EF components for translation",
|
|
5
5
|
"author": "Refinitiv",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"url": "git@github.com:Refinitiv/refinitiv-ui.git",
|
|
13
13
|
"directory": "packages/phrasebook"
|
|
14
14
|
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./lib/index.js",
|
|
17
|
+
"./locale/*": "./lib/locale/*",
|
|
18
|
+
"./lib/locale/*": "./lib/locale/*"
|
|
19
|
+
},
|
|
15
20
|
"scripts": {
|
|
16
21
|
"build": "tsc --sourceMap --declarationMap",
|
|
17
22
|
"build:prod": "tsc",
|
|
@@ -20,12 +25,15 @@
|
|
|
20
25
|
"test": "npm run build && mocha __test__/**/*.js --require esm"
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
|
-
"chai": "4.3.4",
|
|
28
|
+
"chai": "^4.3.4",
|
|
24
29
|
"esm": "^3.2.25",
|
|
25
30
|
"mocha": "^8.4.0"
|
|
26
31
|
},
|
|
27
32
|
"publishConfig": {
|
|
28
33
|
"access": "public"
|
|
29
34
|
},
|
|
30
|
-
"
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tslib": "^2.3.1"
|
|
37
|
+
},
|
|
38
|
+
"gitHead": "dd5c4933b7a76fbeeed086e1fe84b144202b6884"
|
|
31
39
|
}
|