-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Adding czech locale #140
base: main
Are you sure you want to change the base?
Adding czech locale #140
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,10 +324,15 @@ class _PartDayDraggableEventState extends State<PartDayDraggableEvent> { | |
return; | ||
} | ||
|
||
final adjustedOffset = _pointerToWidgetTopCenter(_lastOffset!); | ||
final geometry = _findGeometry(context, adjustedOffset); | ||
widget.onDragCanceled?.call(geometry.key, _wasMoved); | ||
_resetState(); | ||
if (mounted) { | ||
final adjustedOffset = _pointerToWidgetTopCenter(_lastOffset!); | ||
final geometry = _findGeometry(context, adjustedOffset); | ||
widget.onDragCanceled?.call(geometry.key, _wasMoved); | ||
_resetState(); | ||
} else { | ||
widget.onDragCanceled?.call(null, _wasMoved); | ||
_resetState(); | ||
} | ||
Comment on lines
+330
to
+338
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What problem were you seeing with the previous code? With the new code, if this widget is created as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for taking the time to review the code. I apologize for the confusion caused by the incorrect order. I have not realized that the letter "Ch" is specific to my language, Czech. I have implemented the drag-and-drop functionality in my app, using the example app as a guide. However, there have been instances where the To address this issue, I have made a change that ensures the But I see that it conflicts with other functionality. What do you think I should do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A stacktrace:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries, that's an interesting property of the Czech alphabet! Okay, I see the problem. Maybe we should just drop the geometry key parameter of the Alternatively, we could save the geometry key from the last There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks :)! If you think the argument is not helpful, I agree with the first option as it is cleaner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you like me to do it? Or should I create a new pull request with correctly added Czech locales and leave this to you? I am currently not dependent upon this change as I use the fork. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the delay! I'll leave that up to you – go ahead if you want to, otherwise, I'll implement that change before the next release :) |
||
} | ||
|
||
Offset _pointerToWidgetTopCenter(Offset offset) { | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -8,6 +8,8 @@ import 'week.dart'; | |||
/// | ||||
/// Supported [Locale.languageCode]s: | ||||
/// | ||||
/// * `cs` – Czech | ||||
/// * `de` – German | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
/// * `de` – German | ||||
/// * `en` – English | ||||
/// * `es` – Spanish | ||||
|
@@ -89,6 +91,8 @@ class TimetableLocalizationsDelegate | |||
return const TimetableLocalizationDe(); | ||||
case 'en': | ||||
return const TimetableLocalizationEn(); | ||||
case 'cs': | ||||
return const TimetableLocalizationCs(); | ||||
Comment on lines
+94
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this case above |
||||
case 'es': | ||||
return const TimetableLocalizationEs(); | ||||
case 'fr': | ||||
|
@@ -218,6 +222,24 @@ class TimetableLocalizationEn extends TimetableLocalizations { | |||
'Week ${week.weekOfYear}, ${week.weekBasedYear}'; | ||||
} | ||||
|
||||
class TimetableLocalizationCs extends TimetableLocalizations { | ||||
const TimetableLocalizationCs(); | ||||
|
||||
@override | ||||
List<String> weekLabels(Week week) { | ||||
return [ | ||||
weekOfYear(week), | ||||
'Týden ${week.weekOfYear}', | ||||
'T ${week.weekOfYear}', | ||||
'${week.weekOfYear}', | ||||
]; | ||||
} | ||||
|
||||
@override | ||||
String weekOfYear(Week week) => | ||||
'Týden ${week.weekOfYear}, ${week.weekBasedYear}'; | ||||
} | ||||
Comment on lines
+225
to
+241
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this class above |
||||
|
||||
class TimetableLocalizationEs extends TimetableLocalizations { | ||||
const TimetableLocalizationEs(); | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.