ilteoood / flutter_i18n

I18n made easy, for Flutter!
MIT License
217 stars 57 forks source link

load an asset error #187

Closed guchengxi1994 closed 2 years ago

guchengxi1994 commented 2 years ago

Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.json" (404) Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.xml" (404) Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.toml" (404) Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.json" (404) Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.xml" (404) Error while trying to load an asset: Failed to load asset at "assets/assets/i18n/zh_CN.toml" (404)

each time I refreshed pages, I got these errors. but I have already had "zh_CN.yaml" in my assets folders and it works.

ilteoood commented 2 years ago

If you are using only yaml files and you want to suppress these messages, you must use the decodeStrategies parameter.

Take a look here https://github.com/ilteoood/flutter_i18n/blob/master/lib/loaders/file_translation_loader.dart#L27