Localize DatePicker / DateTimePicker - codenameone

I use a DateTime Picker in an editor of my app (within a PickerComponent). I'm using it only in lightweight mode, since DateTime Picker fail on Android if not (not tested since some months, but I suppose it still the case).
I've successfully translated the buttons "Cancel" and "Done" with the L10N API, but I can't translate months (for Date type) or abbreviated day/month (for DateTime).
The keys for each months are putted in the .res file, that worked for the buttons, but it does not work for the months of the picker.
Any hint on how to achieve this localization ? Some of our customer are really bad at english... Thanks in advance !

This is localized via SimpleDateFormat and its class DateFormatSymbols. Unfortunately this has no way to globally customize that value using the standard project resource bundle which seems to be a serious omission of that code. This is something we'll need to fix via the issue tracker, I don't see a short term workaround from a brief glance at the code as it assumes you would have access to the SimpleDateFormat which is highly impractical.

Related

how add Persian Calendar to Hugo

Hugo only uses the Gregorian calendar because of the use of the Google language. And Hugo does not support Plugin.
Is it possible to automatically convert html files to Persian calendar using npm packages like this https://github.com/jalaali/jalaali-js when outputting from Hugo? Or tell me if you have a good solution.
From what I, by the "persian calendar" you mean, the months/lunar cycle in the persian calendar including the day and month names, correct?
This is what I believe you will have to do to get this to work.
As you can see, Hugo uses the GoLang date-time system:
https://gohugo.io/functions/format/#gos-layout-string
which is here: https://golang.org/pkg/time/#ANSIC
It doesn't seem this has a native Lunar calendar system (I call this Lunar calendar because I'm not used to the Persian calendar, but my own cultures, which is Lunar and different than the European system).
But, this can be possibly added:
https://pkg.go.dev/github.com/yaa110/go-persian-calendar
But, as this could be QUITE some work, it could be much simpler if you say EXACTLY what you are trying to do... other than (automatically convert html files to persian calendar).
The answer to that is, sure. Just Grep the string...
But I don't think that's what you are really looking for.
Best of luck!

Does antd support Welsh language

I am using antd date picker. Is there a way to show months and days in date picker in welsh language?
Referred this doc https://ant.design/docs/react/i18n
But couldn't find welsh in it. Is there a way to add welsh in the antd datepicker.
Thanks in advance
Ant Design doesn't seem to support Welsh, but you can add it by yourself.
They state here how you could add a new language to the datepicker, and they even give you an example pull request so you can know which files to add/change.
The best you could do right now is fork the repo, add support for Welsh, make a PR to the project and while it isn't accepted use your own forked version.

Localize lightweight date picker in Codename One

On Android and on iPhone, the Codename One lightweight picker always is in English, like in the following screenshot. How can I localize it in Italian (or in any other language used by the smartphone user)?
You can localize "Cancel" and "Done" in the resource bundle to replace those two labels. The month values are a bit more problematic as they are taken from SimpleDateFormat which doesn't have an easy path for localization. We should probably use the same localization conventions as used by the com.codename1.ui.Calendar class. I think this is something we can track via the issue tracker.

Modify a react library

I have a task from UX designers to create a datepicker that displays multiple months + time.
In our project, we are currently using react-datepicker library to manage our datepickers.
This is the react component used in our project:
https://hacker0x01.github.io/react-datepicker/
The react-datepicker supports both multiple months and time.
The library itself puts the time on the right side of the calendar. However, the UX designers want the time to be at the bottom.
Is there a proper way in doing this without messing around the date-picker library itself? I know it is a big no no to mess around with the library itself, but what options do I have?
Is there a way around this?
If not, I might have to renegotiate with the UX designers.
I decided to create a reusable date range picker component from scratch. I will not be using the react-datepicker at all for this case.

Codename one expect feature on DateTime Component

Our client expects the feature like DateTime Component editable on double topping the Dates or Time or AM/PM instead of scrolling more.
We see that feature on some apps, Can't we get his feature in Codename one. Which is very helpful and will make codename one powerful tool.
Here is a screenshot of what we expect from DateTime picker.
Is there a way to achieve this on Andriod and IOS platforms.
I'm not sure this will work as I'm not much of an Android guy but I made a change to the Android implementation that should allow the keyboard to open if you do:
myPicker.putClientProperty("showKeyboard", Boolean.TRUE);
This should start working following October 29th 2016 with the next update but since I didn't test it this might not work as expected.

Resources