initialize static method

Future<void> initialize(
  1. String filePath,
  2. String currentLanguage
)

Initializes the Loc class with translations from the specified Excel file.

This method loads translations from the Excel file located at filePath for the specified currentLanguage. It should be called before using the get method to retrieve translations.

Implementation

static Future<void> initialize(
    String filePath, String currentLanguage) async {
  _excel = Excel.decodeBytes(await File(filePath).readAsBytes());
  _currentLanguage = currentLanguage;
  _translations = await _loadTranslations();
}