Closed zzxming closed 3 days ago
The changes introduce a new constant defaultLanguage
set to 'en-US'
in editor.config.ts
, enhancing language handling in the editor. The resolveLanguageOption
function in fluent-editor.ts
is modified to utilize this constant for default language settings when the lang
option is undefined. Additionally, two new functions, isObject
and isUndefined
, are added to is.ts
, while the isObject
function is removed from method.ts
. Import statements in debounce.ts
are adjusted without affecting its functionality.
File Path | Change Summary |
---|---|
packages/fluent-editor/src/config/editor.config.ts |
Added new constant: export const defaultLanguage = 'en-US' |
packages/fluent-editor/src/fluent-editor.ts |
Modified resolveLanguageOption to use defaultLanguage for undefined lang options; updated constructor logic in FluentEditor class. Added import for isUndefined . |
packages/fluent-editor/src/utils/debounce.ts |
Adjusted import statements; no changes to the debounce function's logic or functionality. |
packages/fluent-editor/src/utils/is.ts |
Added two new exports: export function isObject(value) and export const isUndefined = (val: unknown) . |
packages/fluent-editor/src/utils/method.ts |
Removed the function: export function isObject(value) . |
defaultLanguage
constant for language management.enhancement
🐇 In the editor's den, a change has come,
A default language, a new beat of the drum.
Withen-US
now set, the words flow with ease,
Language options handled, like a soft summer breeze.
FromisObject
toisUndefined
, we hop and we play,
In the world of code, we brighten the day! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
default language warn should not display when
options.lang
is not configuredIssue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores