Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other locals don't work, timeago throw an exception #175

Open
kanoukou opened this issue Mar 8, 2022 · 0 comments
Open

Other locals don't work, timeago throw an exception #175

kanoukou opened this issue Mar 8, 2022 · 0 comments

Comments

@kanoukou
Copy link

kanoukou commented Mar 8, 2022

Hello,

Using for exemple :

  • timeago.setLocaleMessages('fr', timeago.FrMessages()) to override default locale to French locale and,
  • timeago.format(data[index].time, locale: 'fr')

I get this error :

I/flutter ( 3259): Locale [fr] has not been added, using [en] as fallback. To add a locale use [setLocaleMessages]

Could you please check your published package if there is a typo ?

I think the problem come from this two parts of your timeago.dart source file :

  1. void setLocaleMessages(String locale, LookupMessages lookupMessages) {
    _lookupMessagesMap[locale] = lookupMessages;
    }

  2. if (_lookupMessagesMap[_locale] == null) {
    print("Locale [$_locale] has not been added, using [$_default] as fallback. To add a locale use [setLocaleMessages]");
    }

Thanks in advance for your help.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant