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

How to change language/name for days #23

Open
joj3000 opened this issue Jul 1, 2020 · 4 comments
Open

How to change language/name for days #23

joj3000 opened this issue Jul 1, 2020 · 4 comments

Comments

@joj3000
Copy link

joj3000 commented Jul 1, 2020

Hi,

How would you change the language/name for the days ? (I want to use the French names for the days).

I've tried many things :

  • modify the _stringRepresentations in dayoftheweek.dart
  • use intl package
  • tried the theme in TimetableThemeData

Thanks, and again great package !

@JonasWanke
Copy link
Owner

time_machine is used internally for all date & time formatting. By default, it uses en_US as its locale (managed by the Culture class) and doesn't know about Flutter's locale. To change it to French, set Culture.current after the call to TimeMachine.initialize:

await TimeMachine.initialize({'rootBundle': rootBundle});
// Supported cultures: https://github.com/Dana-Ferguson/time_machine/tree/master/lib/data/cultures
Culture.current = await Cultures.getCulture('fr');
runApp(/* ... */);

There's an open issue for time_machine to provide a LocalizationsDelegate for easier integration: Dana-Ferguson/time_machine#28

@joj3000
Copy link
Author

joj3000 commented Jul 1, 2020

Great, thank you very much !

@JulianKowalczuk
Copy link

@JonasWanke, could You put this info in readme? Some newbies won't dig in PRs to find out that and this is probably why flutter_week_view package is more popular, even I think Your one is better.

JonasWanke added a commit that referenced this issue Jul 6, 2020
@JonasWanke
Copy link
Owner

@JulianKowalczuk Thanks! I've just published v0.2.5 and added a Localization section to the README.

I'll still leave this issue open as I want to simplify this soon.

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

Successfully merging a pull request may close this issue.

3 participants