IBM Worklight 5.0.6 - How to globalise system messages - translation

I am trying to enable the system messages translation option but it is failing in my project.
In my main page js file i declare the following code globally
WL.ClientMessages.loading = "Custom loading";
function wlCommonInit(){
var locale = WL.App.getDeviceLocale();
var lang = WL.App.getDeviceLanguage();
if (locale.indexOf("en")!=-1) languageChanged("english");
if (locale.indexOf("fr")!=-1) languageChanged("french");
if (locale.indexOf("ru")!=-1) languageChanged("russian");
if (locale.indexOf("he")!=-1) languageChanged("hebrew")
}
This is hw to globalise the application strings but i have small doubts are
1. wt is system strings
2. How to translate the it
i have gone through the docs but not clear to me pls help me out

This snippet is not enough... it doesn't show exactly what you're doing in your app.
Please follow the Enabling Translation training module for the proper steps to make.
There is also an example project that shows you how it is done. Compare it with yours.
Translation of native components (like the busy indicator) based on the system locale will be available in a future release.
In Worklight 5.0.6, the first busy indicator you see is controlled by Worklight and you cannot translate it. To overcome this, set connectOnStartup to 'false' and create your own busy indicator. You can then translate its message as described in the module.
Please go over the IBM Worklight Getting Started materials to familiarize yourself with the Worklight platform.

Related

Programming CAN bus for STM32F446RE with CubeMX and uVision 5

I'm trying to program the STM32F446 using the CubeMX code generator
and the uVision 5 IDE on Windows 10 in order to use the CAN bus.
I've configured my CubeMX project for the STM32-F446RE Nucleo board.
I have PA12 configured as CAN1TX and PA11 configured as CAN1RX.
The rest of the pins are on default for the STM32-F446RE Nucleo board.
I've generated the code for the uVision 5 IDE.
To get started, I'm trying to follow the instructions on how to use the HAL and driver by following the instructions in the comments of stm32f4xx_hal_can.c as well as the instructions on page 120 of the HAL documentation DocID025834 Rev 5.
This page gives the following instructions:
Enable the CAN controller interface clock using __HAL_RCC_CAN1_CLK_ENABLE() for CAN1, __HAL_RCC_CAN2_CLK_ENABLE() for CAN2 and __HAL_RCC_CAN3_CLK_ENABLE() for CAN3 In case you are using CAN2 only, you have to enable the CAN1 clock.
CAN pins configuration
 **Enable the clock for the CAN GPIOs using the following function:
__GPIOx_CLK_ENABLE() **
....
The first substep of step 2 is the problem. I cannot find the function
__GPIOx_CLK_ENABLE(). I've noticed in some other forum that there may be an alternate name for the function, __HAL_RCC_GPIOx_CLK_ENABLE(); but it is not recognized by the IDE either. Am I missing an include file? Is the "x" supposed to be replaced by some number like the pin number of the pin I want to use?
If so, what format should the pin be expressed?
To my further confusion, I've looked at various youtube videos and none of them seem to mention the steps above mentioned in the HAL manual.
I have installed on my IDE the following, amongst others:
Generic:
ARM::CMISS-Driver version 2.3.0 and 2.2.0,
ARM::CMISS version 5.4.0 and version 5.3.0.
Device Specific info:
Keil::STM32F4xx_DFP version 2.13.0.
Keil::STM32NuceloBSP version 1.6.0.
I've been looking around for information but without success,
and would very much appreciate your help.

How do I test my GtkPrintBackend?

I am trying to develop my own GtkPrintBackend ,
taking help from here:
https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html
I want to test my print backend( by making the print dialog use my backend instead). How do I do that?
That is, how do I make the Print dialog use my backend instead?
Answering my own question here since I figured out a workaround:
I installed jhbuild and built the gtk+ module using jhbuild.
The source code of the corresponding module is downloaded in ~/jhbuild/checkout/<module-name> .
Modify the print backends under ~jhbuild/checkout/gtk+/gtk/modules/printbackends/ directory, and rebuild it (Find instructions to do that here).
Now when you launch a gtk application from the jhbuild shell, it will use the modified backend instead of the system default one.

WebSharper 3.4 with working HelloWorld example?

The current HelloWorld example on websharper.com doesn't work anymore due to changes made in WebSharper 3.4. It now requires some attributes and other stuff to compile correctly.
I am just getting started with WebSharper and I would like to see a minimum (html+javascript client-side hello world) example that works. Any help would be appreciated!
The samples on the website use Html.Client (the HTML language soon to be retired in favor of UI.Next), so to run them you need to start from a template that isn't based on UI.Next.
Following the instructions here, I was able to run them without any issues, extra attributes, etc.

Cordova white screen of death iOS - browserify, react, cordova

I have a strange situation with a project for iOS.
Its created using browserify and React for Cordova and aimed at iOS.
We have built the project for iOS using Cordova commands without any issues. It runs with no xcode errors or Javascript errors either however none of the JS ui appears on screen. We just get a blank white screen with the system bar at the top. See attached screen shot.
So far we have found out that if you add HTML to the index.html in WWW folder it prints that fine so I assume its the JS.
When we run in a browser it works as well as building for Android.
We have no problems with anything other than iOS (simulator and device build).
hopefully someone can help me out here because I'm stumped. Please let me know what files you need to look at and I'll make them available.
Thanks in advance.
IMAGES
The error screen: http://www.voidapplications.co.uk/errorScreen.png
What we expect to be shown: http://www.voidapplications.co.uk/whatWeExpect.png
If you are using internationalization component that's because you need to use the Intl polyfill:
Intl.js and FT Polyfill Service
Intl.js polyfill was recently added to the Polyfill service, which is developed and maintained by a community of contributors led by a team at the Financial Times. It is available thru cdn.polyfill.io domain, which routes traffic through Fastly, which makes it available with global high availability and superb performance no matter where your users are.
To use the Intl polyfill thru the Polyfill service just add one script tag in your page before you load or parse your own JavaScript:
<script src="https://cdn.polyfill.io/v1/polyfill.min.jsfeatures=Intl.~locale.en"></script>
When specifying the features to use thru the polyfill service, you have to specify what locale, or locales to load along with the Intl polyfill for the page to function, in the example above we are specifying Intl.~locale.en, which means only en, but you could do something like this:
<script src="https://cdn.polyfill.io/v1/polyfill.min.js?features=Intl.~locale.fr,Intl.~locale.pt"></script>
note: the example above will load the polyfill with two locale data set, fr and pt.
This is by far the best option to use the Intl polyfill since it will only load the polyfill code and the corresponding locale data when it is really needed (e.g.: safari will get the code and patch the runtime while chrome will get an empty script tag).
source & other ways to include Intl polyfill: https://github.com/andyearnshaw/Intl.js#getting-started
You can debug the UIWebView in the simulator with Safari http://moduscreate.com/enable-remote-web-inspector-in-ios-6/. You'll probably see a big error message in the console, if not you will have access to the debugger so you can step through and sort it out.
I have had this issue in the past, it turned out to be unsupported javascript features. for example, setting default parameters in the function. I.e:
function test( myvalue=0 ) { /* ... */ };
I had to initialise the value inside the function instead. You could also try removing any ecma script 2016 features you may have implemented.
Trouble shooting this type of issue was painful. I created a minimal version of the smallest part of my product compiled and ran it on ios emulator, added another chunk of the product, rinse and repeat.
Im sure there's a better way to detect these issues, but I do not know it.

How to pass data in body of a HttpConnection in blackberry

Actually I want to pass data in body of a httpconnection.
Using apache httpclient library in blackberry, integrated jar file in my project but getting compilation error while running my project.
Kindly updated me on the same.
I have not tried using Apache HttpClient lib in a BB project before, because I did not for a moment think it would work...
In short, you need the code to be compatible with J2ME, and compilable using the RIM tool chain. And then we get into other problems....
First of, be aware that networking in BlackBerry is NOT as straightforward as one might wish.
Have a look at this video for the back ground theory: Networking Transports on the BB Platform
Ok, then for some code (I assume here you already went through the trouble of obtaining an HttpConnection):
byte [] bodyBytes = getBodyBytesFromSomewhere();
OutputStream out = httpConnection.openOutputStream();
out.write(bodyBytes);
out.flush();
out.close();//If you are done, which I'm guessing you are
The above code is of course very simplistic, and completely ignores all the many, many errors that will occur during network IO.
I would suggest you also look at this API,this forum entry,and this one. OS6.0 also introduced a new HTTP Connection API - can't find a link for that right now (sorry!)

Resources