dart-lang / i18n

A general mono-repo for Dart i18n and l10n packages.
BSD 3-Clause "New" or "Revised" License
64 stars 40 forks source link

Persian calendar #207

Open HansMuller opened 5 years ago

HansMuller commented 5 years ago

This issue was originally reported against the Flutter project: https://github.com/flutter/flutter/issues/28926

The problem has to do withPersian week names:

This package very useful for Persians but I have a problem This package don’t support week mood

saeedgir commented 3 years ago

Hi @HansMuller There are some problem in Intl library for Persians.

setbap commented 3 years ago

up

h1376h commented 4 months ago

Any updates?

mosuem commented 4 months ago

Persian calendars will be supported in package:intl4x, see the options.

h1376h commented 4 months ago

Is there any roadmap or estimated date? Most of the current packages on 'pub', try to copy Material widgets and are outdated. An official support for other calendar locales would be a really nice feature to use.

mosuem commented 4 months ago

We are working on shipping a stable version ASAP.

Most of the current packages on 'pub', try to copy Material widgets and are outdated.

What do you mean with copying material widgets? Could you give examples? I am not very knowledgeable about Flutter.

h1376h commented 4 months ago

There are some design systems for building good looking things (widgets) on different operating systems. Android suggests using Material (flutter's implemention), apple has it's own one (flutter's implementation). And in current state of dart/flutter, because DateTime class itself does not support other formats, a developer should copy and modify the flutter's implemention (or other people's codes) for each of these different looks in a big project! Just for 10-20 line changes in each of them! And they keep updating, fixing bugs or maybe even a whole new look in the next iOS, Android, macOS, Windows design.

This could easily be done in a future that there exists a 'type' for different dateTimes.

For example, a package with more than 2000 lines uses this somewhere:

final String dateText =
          DateFormat(timeSlotViewSettings.dateFormat).format(currentDate);

In current state of dart/flutter, a developer could use (shamsi_date) package

import 'package:shamsi_date/shamsi_date.dart' show Jalali;

and change that line to:

final Jalali jalali = Jalali.fromDateTime(currentDate);
final String dateText = jalali.day.toString();

And therefore copying 2000 lines and always checking that package's changes and bug fixes, just for changing 1 or 2 lines everyime.

mosuem commented 4 months ago

Thanks for the explanation, that makes sense. Although people would maybe even like to use their own i18n packages, so making this injectable would also be nice for Flutter.