Releases: bigBear713/nb-trans
Releases · bigBear713/nb-trans
18.0.0
17.0.0
v17.0.0
Breaking Changes
- feat: Upgrade
angular
tov17
;
v17.0.0
破坏性更新
- feat:
angular
升级到v17
;
16.0.0
Breaking Changes
- feat: Upgrade
angular
to^16.0.0
; - feat: Upgrade
@bigbear713/nb-common
to^16.0.0
; - feat: INbTransParams - Limit the naming rules about params's key: Consists of
letters, numbers, _, and $
, and the number can't be the first character; - feat:
<nb-trans />
- Thekey
prop is required: issue/25;
Dependencies
- chore: Remove
uuid
lib;
Services
- refactor: NbTransService - Refactor the function for handling the dynamic params in translated string;
- fix: NbTransService - Fix the bug abouf will get object data when the trans key is incomplete: issue/27;
- feat: NbTransService - Support for spaces between
dynamic params
and{{}}
in translated string: issue/34;
Components
- feat:
[nb-trans]
- Add the component which the selector is[nb-trans]
: issue/22; - perf:
<nb-trans />
- Use the UnsubscribeService to manage the rxjs subscription; - fix:
<nb-trans />
- Fix the bug about the trans result is wrong in some case: issue/28;
Pipes
- feat: nbTrans - Use the UnsubscribeService to manage the rxjs subscription;
Tokens
- feat: NB_TRANS_PARAM_KEY_INVALID_WARNING - Whether to print a warning info in the console, when a param key is invalid;
破坏性更新
- feat:
angular
升级到^16.0.0
; - feat:
@bigbear713/nb-common
升级到^16.0.0
; - feat: INbTransParams - 限制 params 中的
key
的命名规则:由字母、数字、_ 和 $ 组成,且 数字 不能为第一个字符; - feat:
<nb-trans />
-key
属性添加必填校验:issue/25;
依赖
- chore: 移除
uuid
库;
Services
- refactor: NbTransService - 重构翻译文本中动态参数的处理方式;
- fix: NbTransService - 修复当 params 的 key 值不完整时会得到object类型的数据的问题:issue/27;
- feat: NbTransService - 支持在翻译文本中,
动态参数
和{{}}
之间存在空格:issue/34;
Components
- feat:
[nb-trans]
- 新增选择器为[nb-trans]
的组件:issue/22; - perf:
<nb-trans />
- 使用 UnsubscribeService 管理rxjs的订阅事件; - fix:
<nb-trans />
- 修复在一些情况下,翻译结果错误的问题:issue/28;
Pipes
- feat: nbTrans - 使用 UnsubscribeService 管理rxjs的订阅事件;
Tokens
- feat: NB_TRANS_PARAM_KEY_INVALID_WARNING - 当 param key 不符合规则时,是否在 console 中打印警告信息;
v15.1.0
Components
- feat:
<nb-trans></nb-trans>
- 支持以standalone component
的方式引入 - feat:
[nb-trans-subcontent]
- 支持以standalone component
的方式引入
Pipes
- feat: nbTrans - 支持以
standalone component
的方式引入
Components
- feat:
<nb-trans></nb-trans>
- Support to be imported as astandalone component
- feat:
[nb-trans-subcontent]
- Support to be imported as astandalone component
Pipes
- feat: nbTrans - Support to be imported as a
standalone component
v15.0.0
破坏性更新
- feat:
angular
升级到^15.0.0
; - feat:
@bigbear713/nb-common
升级到^15.0.0
;
依赖
- feat:
uuid
升级到^9.0.0
;
Tokens
- feat: 增加NB_TRANS_MAX_RETRY,
NB_TRANS_MAX_RETRY_TOKEN
标记为deprecated
;
Enums
- feat: 增加NbTransLang,
NbTransLangEnum
标记为deprecated
; - feat: 增加NbTransSentenceItem,
NbTransSentenceItemEnum
标记为deprecated
;
Services
- refactor: 优化NbTransService;
Pipes
- refactor: 优化nbTrans;
Breaking Changes
- feat: Upgrade
angular
to^15.0.0
; - feat: Upgrade
@bigbear713/nb-common
to^15.0.0
;
Dependencies
- feat: Upgrade
uuid
to^9.0.0
;
Tokens
- feat: Add NB_TRANS_MAX_RETRY, mark
NB_TRANS_MAX_RETRY_TOKEN
asdeprecated
;
Enums
- feat: Add NbTransLang, mark
NbTransLangEnum
asdeprecated
; - feat: Add NbTransSentenceItem, mark
NbTransSentenceItemEnum
asdeprecated
;
Services
- refactor: optimize NbTransService;
Pipes
- refactor: optimize nbTrans;
v14.0.0
破坏性更新
- feat:
angular
升级到v14
;
Breaking Changes
- feat: Upgrade
angular
tov14
;
v13.0.1
依赖
- fix:
nb-common
版本调整为^13.0.0
;
Dependencies
- fix: Update the version of
nb-common
as^13.0.0
;
v13.0.0
破坏性更新
- feat:
angular
升级到v13
;
Breaking Changes
- feat: Upgrade
angular
tov13
;
v12.1.0
Services
NbTransService
- feat:
NbTransService.getBrowserLang()
可以直接获取浏览器的首选语言; - depr:
getBrowserLang()
被标志为deprecated
; - feat:
NbTransService.getBrowserLangs()
可以直接获取一个用户已知语言的数组; - depr:
getBrowserLangs()
被标志为deprecated
;
Services
NbTransService
- feat:
NbTransService.getBrowserLang()
can the first language of browser directly - depr:
getBrowserLang()
has been marked asdeprecated
; - feat:
NbTransService.getBrowserLangs()
can a language array known directly - depr:
getBrowserLangs()
has been marked asdeprecated
;
v12.0.0
Module
- feat: NbTransModule - 提供可用的
component
,pipe
- feat: NbTransTestingModule - 提供单元测试环境
Services
- feat: NbTransService - 提供多语言翻译功能
Components
- feat:
<nb-trans></nb-trans>
- 当翻译文本中含有组件等复杂场景时使用的组件 - feat:
[nb-trans-subcontent]
- 当翻译文本中含有组件嵌套时使用的一种官方提供的方案(可根据需要有自己的实现方式),会将嵌套的组件内容渲染出来
Pipes
- feat: nbTrans - 翻译文本的管道
Tokens
- feat: NB_TRANS_DEFAULT_LANG - 设置默认语言
- feat: NB_TRANS_LOADER - 翻译文本加载器
- feat: NB_TRANS_MAX_RETRY_TOKEN - 翻译文本加载失败时的最大重试次数
Interfaces
- feat: INbTransLoader - 文本加载器
- feat: INbTransOptions - 翻译配置
- feat: INbTransParams - 翻译文本中的参数
- feat: INbTransChangeLang - 切换语言的结果
- feat: INbTransSentencePart - 句子部分
- feat: INbTransSentenceCompPart - 句子中含有组件的部分
Enums
- feat: NbTransLangEnum - 常用语言枚举
- feat: NbTransSentenceItemEnum - 句子项类型枚举
Module
- feat: NbTransModule - provide useful
component
,pipe
- feat: NbTransTestingModule - provide the env to unit test
Services
- feat: NbTransService - provide the translate feature
Components
- feat:
<nb-trans></nb-trans>
- when you need to translate the sentence which include components - feat:
[nb-trans-subcontent]
- it is a common solution when the sentence include some nested componets (you can impletement yourself to meet the requirement)
Pipes
- feat: nbTrans - the pipe which to tranlate the text
Tokens
- feat: NB_TRANS_DEFAULT_LANG - set the default langs
- feat: NB_TRANS_LOADER - the loader of translated text
- feat: NB_TRANS_MAX_RETRY_TOKEN - the max retry time when failure to load translated file
Interfaces
- feat: INbTransLoader - the translated file loader
- feat: INbTransOptions - the config of translation
- feat: INbTransParams - the params in the translated text
- feat: INbTransChangeLang - the result of switching language
- feat: INbTransSentencePart - the part of sentence
- feat: INbTransSentenceCompPart - the part which include component in sentence
Enums
- feat: NbTransLangEnum - the enum of common language
- feat: NbTransSentenceItemEnum - the enum of sentence item