easy_localization
easy_localization copied to clipboard
RangeError (index): Invalid value: Only valid value is 0: -1
I am getting this issue after loading the CSV file The code is the same as you give an example
Problem in your CSV, please find same issue
I have the same problem when using csv. Everything in csv seems to be ok. What else could be wrong?
I think we need a proper csv editor or extension to edit or create csv file
On Fri, Jan 15, 2021, 12:23 AM Mutlu Şimşek [email protected] wrote:
I have the same problem when using csv. Everything in csv seems to be ok. What else could be wrong?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aissat/easy_localization/issues/296#issuecomment-760414911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBGGNYBGZIHWQQMPFF2BELSZ5AC7ANCNFSM4UTKBCPA .
I keep getting this error. Is there any solution?
I had to modify the source code of CsvAssetLoader:
CSVParser(this.strings, {this.fieldDelimiter = ','})
: lines = CsvToListConverter(csvSettingsDetector: FirstOccurrenceSettingsDetector(
fieldDelimiters: [',', ';'],
textDelimiters: ['"', "'"],
textEndDelimiters: ['"', "'"],
eols: ['\r\n', '\n'],
),)
.convert(strings, fieldDelimiter: fieldDelimiter);
FirstOccurrenceSettingsDetector
parameters should be promoted to CsvAssetLoader
. Currently, I had to modify the source code of CsvAssetLoader
due to this.
@deadsoul44 Your problem is in the csv file Make sure that the English language is present "en" and that the language name is correct Like("en_US, en_UK , ar_DZ, ar_LB...)
@deadsoul44 Your problem is in the csv file Make sure that the English language is present "en" and that the language name is correct Like("en_US, en_UK , ar_DZ, ar_LB...)
My file looks good here, but i am still facing the problem. @mstfkhazaal .. can you help?
@ch-muhammad-adil add to csv file en de column
@ch-muhammad-adil add to csv file en de column Like
key,en ,en_US, de, de_DE home, Home,Home,Heim,Heim ....
I see problem comes when i use useFallbackTranslations: true,
below. If i remove that then it works fine .. @mstfkhazaal
supportedLocales: [Locale('en', 'US'), Locale('de', 'DE')],
path: 'assets/localization/alp_localization.csv',
fallbackLocale: Locale('en', 'US'),
startLocale: Locale('en', 'US'),
assetLoader: CsvAssetLoader(),
useFallbackTranslations: true,
Thank you for quick response @mstfkhazaal , so problem was useFallbackTranslations: true,
not sure what connection it has here.
When you use useFallbackTranslations: true,
you are forced to add the original language