tastyigniter / TastyIgniter

:fire: Powerful, yet easy to use, open-source online ordering, table reservation and management system for restaurants
https://tastyigniter.com
MIT License
2.98k stars 976 forks source link

Installer language and timezone #991

Closed mahmoudawadeen closed 2 years ago

mahmoudawadeen commented 2 years ago

As referenced in https://github.com/tastyigniter/TastyIgniter/issues/904

Reopen of https://github.com/tastyigniter/TastyIgniter/pull/908

Choosing the language Screenshot 2022-06-16 at 16 27 38

Split timezone selection: Example choosing Africa image

image Example choosing Europe Screenshot 2022-06-16 at 16 24 32

ryanmitchell commented 2 years ago

I like this, but I wonder if it might be simpler just using anticipate and autocomplete? Saves long lists... ?

mahmoudawadeen commented 2 years ago

I like this, but I wonder if it might be simpler just using anticipate and autocomplete? Saves long lists... ?

I see your point, however, the main idea of having a list was to limit the user from entering invalid choices. I split the timezone on two steps to limit the max length of the list. If it's really worth it to have a smaller list than this, we could do UTC +/- list, however i'd need to translate it to a timezone that TI understands. I could randomly choose one of the timezones that matches the UTC +/- but that can lead to confusion since there are multiple timezones with the same offset.

ryanmitchell commented 2 years ago

To me if the dev enters an incorrect value thats on them... but I'll let @sampoyigi make the call

sampoyigi commented 2 years ago

Nice how you broke out the timezone into continents. I believe we can apply the anticipate and autocomplete approaches, and to avoid users entering invalid timezone/locale, we can validate user input and ask again if necessary.

Not sure if its possible, what about an approach that detects the system locale and timezone and recommends using it during igniter:install? The user can either confirm using the system default settings or choose from the list. Can we also determine which locale to use based on the timezone?

mahmoudawadeen commented 2 years ago

@sampoyigi

I believe we can apply the anticipate and autocomplete approaches, and to avoid users entering invalid timezone/locale, we can validate user input and ask again if necessary.

The choices for the regions provide auto-complete since the actual choice is a string, not a number. Here i only typed "A": Screenshot 2022-06-17 at 11 29 05 I can also do the same for the timezones so the user has the full list of options and can use auto-complete.

Not sure if its possible, what about an approach that detects the system locale and timezone and recommends using it during igniter:install? The user can either confirm using the system default settings or choose from the list.

I don't think it's necessary that the developer is in the same timezone or locale.

Can we also determine which locale to use based on the timezone?

I wouldn't overcomplicate the logic there.

TODO:

  1. Change the timezone choices list to support auto-complete while still showing the list.
sampoyigi commented 2 years ago

I wouldn't overcomplicate the logic there.

That's fine with me.

sampoyigi commented 2 years ago

Another thing, this PR should target the flame/v4 branch, the new destination for v4 stuff.