Skip to content

Commit

Permalink
call setLanguageMap in initialization.ts
Browse files Browse the repository at this point in the history
this will help to translate translateSchemaMap after reload app when change language
  • Loading branch information
zaqoutabed authored Jul 7, 2023
1 parent 6cb2fed commit 1e86c2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getRandomString,
getValueMapFromList,
} from 'utils/index';
import { setLanguageMap } from './language';

export async function initializeInstance(
dbPath: string,
Expand All @@ -33,6 +34,10 @@ export async function initializeInstance(
await setInstanceId(fyo);
await setOpenCount(fyo);
await setCurrencySymbols(fyo);
const language = (fyo.config.get('language') as string) || fyo.store.language || 'English';

Check warning on line 37 in src/utils/initialization.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

Insert `⏎···`
if(language){

Check warning on line 38 in src/utils/initialization.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

Replace `(language)` with `·(language)·`
await setLanguageMap(language || fyo.store.language)

Check warning on line 39 in src/utils/initialization.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

Insert `;`
}
}

async function closeDbIfConnected(fyo: Fyo) {
Expand Down

0 comments on commit 1e86c2e

Please sign in to comment.