Skip to content

Commit

Permalink
Update debug mode property name
Browse files Browse the repository at this point in the history
  • Loading branch information
3adel-bassiony committed Jan 27, 2024
1 parent d787a9c commit a9e4f57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ The I18XS package comes with a comprehensive set of features designed to make in
i18xs.isCurrentLocaleLTR // -> True || False
```
- **isDebugEnabled**: Check if the debug mode is enabled or not
- **isShowLogs**: Check if the debug mode is enabled or not
```javascript
i18xs.isDebugEnabled // -> True || False
i18xs.isShowLogs // -> True || False
```
 
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ export default class I18XS {
* @returns {boolean} The debug mode status.
* @example
* const i18n = new I18n();
* if (i18n.isDebugEnabled) {
* if (i18n.isShowLogs) {
* console.log('Debug mode is enabled');
* } else {
* console.log('Debug mode is disabled');
* }
*/
get isDebugEnabled(): boolean {
get isShowLogs(): boolean {
return this._showLogs
}

Expand Down
4 changes: 2 additions & 2 deletions src/tests/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('I18XS', () => {
expect(i18xs.localization).toEqual({ Hello_World: 'مرحبا بالعالم' })
expect(i18xs.isCurrentLocaleRTL).toBe(true)
expect(i18xs.isCurrentLocaleLTR).toBe(false)
expect(i18xs.isDebugEnabled).toBe(true)
expect(i18xs.isShowLogs).toBe(true)
expect(i18xs.t('Hello_World')).toBe('مرحبا بالعالم')
expect(i18xs.t('Old_Hello_World')).toBe('Old_Hello_World')
})
Expand Down Expand Up @@ -272,7 +272,7 @@ describe('I18XS', () => {

// test('It should enable debug mode', async () => {
// const i18xs = new I18XS({ currentLocale: 'he', supportedLocales: ['en', 'ar'], showLogs: true })
// expect(i18xs.isDebugEnabled).toBe(true)
// expect(i18xs.isShowLogs).toBe(true)
// i18xs.changeCurrentLocale('ar')
// const consoleSpy = vi.spyOn(console, 'debug')
// expect(consoleSpy).toHaveBeenCalledWith('Changed current locale to ar')
Expand Down

0 comments on commit a9e4f57

Please sign in to comment.