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.
Related
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!
I know that is possible to programmatically format a text in Codename One using something like "Rich Text View". But in my use case the user can do basic formatting of the text.
For example, see the following two screenshots of the Protonmail app. How can I do something similar with Codename One?
In the first screenshot, "Taglia" means "Cut" and "Copia" means "Copy".
In the second screenshot, "Grassetto" means "Bold" and "Corsivo" means "Italic".
We don't support that. This behavior is very inconsistent between platforms and pretty limited in all native platforms so implementing it in a cross platform way isn't practical.
However, since all platforms have good HTML5 support it's pretty easy to implement it with a WebView by embedding a web based rich edit widget. Since these consistently work with HTML the results are cross platform and should be easy to work with. In the past we had a CKEditor cn1lib but I think it's out of date by now. The core concept should work though and should be much easier to implement as we now support the html package for deploying web resources. So you can take any HTML based text editor and just place the files under the src/html directory then open that hierarchy for editing.
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.
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.
first of all, please excuse my ignorance, this is an exploratory question, rather than a specific programming program that needs solving.
I have a number of clients that have unique websites, none of which I was involved in developing. I would like them to be able to display a calendar of common events, but which would also contain events unique to them.
Is it possible using something like Server Side Includes to be able to give them a few lines of code which they could insert into their website (on any particular page) which might display a calendar type display, which their users can then interact with?
I guess I am looking for something similar to a Google calendar but I do not want to use a Google calendar. The key thing would be that they would only need to insert the few lines of code on one of their webpages; they wouldn't have to install any software on their servers.
Any suggestions?
Thanks
Damien
There are are all sorts of web calendars that will allow you to include them on a web page (typically using javascript, not SSI). Some are targeted at specific platforms (ie, Wordpress) and some are more generic.
Try searching "web calendar widget" for examples.
You'd have to put some amount of content on their site. If you can do that, you can include some javascript that will load more javascript from the server side that can do the bulk of the calendaring work for you.
You wouldn't be able to just drop a few files on the server and have them work, you'd need some way to link to them by changing the existing content on at least one of the pages.
I may be misunderstanding your question though.
If you are looking for specific recommendations on web calendar widgets, Arshaw's fullcalendar is my favorite to date.
It displays a great calendar that can be easily styled with css or jquery ui themeroller and is very programmable. The website has great documentation and examples as well.
Per using it on different sites, it supports that easily.
Note, I'm not affiliated with that calendar at all, just a satisfied customer.