IBM Worklight - How to add multi-language support? - ibm-mobilefirst

How do you add multi-language support in a Worklight app? Can anyone give me some example?

There is documentation about how to do it with Worklight: http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.help.doc%2Fwl_home.html
You can use Cordova API to detect the language and write code built on it: http://cordova.apache.org/docs/en/2.5.0/cordova_globalization_globalization.md.html
If you are using Dojo in your application you can use the http://dojotoolkit.org/reference-guide/1.9/quickstart/internationalization/
and
http://dojotoolkit.org/reference-guide/1.9/quickstart/internationalization/globalization-guidelines/
If you are using jQuery there are plugins that do that as well, like: https://code.google.com/p/jquery-i18n-properties/

Use the file common/js/messages.js
Use this istruction for the loading
if(WL.App.getDeviceLanguage() == 'en' && WL.App.getDeviceLocale() == 'en-US') {
WL.ClientMessages.loading = 'Custom Loading Message';
}
and
WL.ClientMessages.loading = Messages.wrklight;
Here the doc

Related

How can I configure Editor Tracking in ArcObjects 10.3 for .net for a table programmatically?

I use ArcObjects for .net for ArcGis 10.3.
I didn't find any interface to configure editor tracking for a table of GDB database.
How can I configure Editor Tracking for a table programmatically?
I found interface IDEEditorTracking but I didn't find a method to use it.
For your reference..first you need to find the dataelement(IDataElement) and then use enable editor geoprocessing tool..
IWorkspace pworkspace = ((IDataset)pfeaturelayer.FeatureClass).Workspace;
IGeoProcessor pGP = new GeoProcessor();
IGPDataType pGPDataType = new DEFeatureClassType() as IGPDataType;
IDataElement pDataElement = pGP.GetDataElement(pworkspace.PathName, pGPDataType);
IDEEditorTracking editorTracking = (IDEEditorTracking)pDataElement;
if (!editorTracking.EditorTrackingEnabled)
{
//now use Enable Editor Tracking geoprocessor tool
}

I need to creat a multi language chatbot in react native with dialogFlow

I need to put the multilanguage support in my chatBot.
here some code and link of tutorial that I followed.
https://blog.jscrambler.com/build-a-chatbot-with-dialogflow-and-react-native/
Here, is especified --> Dialogflow_V2.LANG_ENGLISH_US,
But i need the multilanguage...
componentDidMount() {
Dialogflow_V2.setConfiguration(
dialogflowConfig.client_email,
dialogflowConfig.private_key,
Dialogflow_V2.LANG_ENGLISH_US,
dialogflowConfig.project_id
);
}
Use react-native-localize to add the ability of multiple language support.
You can use react-native-localize with I18n-js (but also with react-intl, react-i18next, etc. The choice is yours!)
⚠️ Deprecated:
We can use an internationalization module named react-native-i18n to add many languages in our React Native projects.
Install the following module to link with your project.
npm i react-native-i18n --save
For more details, please go through How to add localization (i18n, g11n) and RTL support to a React Native project.
reference by
Set the language in your configuration: that you can set your own language suport in chatbot:
componentDidMount() {
Dialogflow_V2.setConfiguration(
dialogflowConfig.client_email,
dialogflowConfig.private_key,
Dialogflow_V2**.LANG_ENGLISH_US,**
dialogflowConfig.project_id
);
}
LANG_CHINESE_CHINA
LANG_CHINESE_HONGKONG
LANG_CHINESE_TAIWAN
LANG_DUTCH
LANG_ENGLISH
LANG_ENGLISH_GB
LANG_ENGLISH_US
LANG_FRENCH
LANG_GERMAN
LANG_ITALIAN
LANG_JAPANESE
LANG_KOREAN
LANG_PORTUGUESE
LANG_PORTUGUESE_BRAZIL
LANG_RUSSIAN
LANG_SPANISH
LANG_UKRAINIAN

WebRTC with Agora.io: SwitchCamera?

I'm building a web app using Agora.io. I'd like to be able to switch from the front-facing to the rear-facing camera on a client's smartphone. I've seen agora docs for switchCamera. I've tried the following:
switchCamera();
myAgoraClient.switchCamera();
localStream.switchCamera();
All of them throw a no such function error.
What is the correct way to switch the camera in agora.io for web?
You can do this with switchDevice method in 2.5 SDK
switchDevice(type: string, deviceId: string, onSuccess: function,
onFailure: function): void
For example;
localStream.switchDevice("video", "<deviceid>", console.log,console.log)
Should do the work. I was trying same thing but examples contains old 2.4 js sdk, you need to specifically download ^2.5
I don't think the latest version of Agora Web SDK have these methods out of box.
However, you can create a camera list through:
AgoraRTC.getDevices(function(devices){
cameras = devices.filter(device => device.kind === 'videoinput');
});
Then give switchCamera an implementation:
function switchCamera(){
cameraIndex = (++cameraIndex) % cameras.length;
}
Use cameras[cameraIndex].deviceId as cameraId to create a new local video stream and publish it out.

Setting class when calling createLabel

I'm using Titanium Studio and Titanium SDK. In this case I'm developing for Android but I have an installation on OSX too.
When using Alloy, I can specify
<Label class="header" id="someId">Week 50</Label>
and then specify the colors,fonts etc in the TSS file like this
".header": {
color: "blue"
}
However when I use the SDK version:
var l = Ti.UI.createLabel({class:"header", text:"sometext"});
The color from the TSS file isnt picked up???
What am I doing wrong. Isn't 'class' a valid property? (I cant seem to find it in the docs).
Alloy style are applied automatically to views created through xml. If you want to keep that effect while you are creating objects inside controller you have to use $.UI.create() method instead of Titanium API. In your case your code will look like this:
var l = $.UI.create('Label', {
title: "sometext",
classes: ["header"],
});
For more read Dynamic Styles guide. It's not very well documented and some parts of it were unclear for me when I read it but it's good starting point to experiment with the code and learn Alloy behaviour.
Encountered you question while I was searching for something similar. The chosen answer was unfortunately not the solution I was looking for, since I was writing a commonJS and needed the same this. If you are writing a commonJS (but still under an Alloy project) you can use the following solution:
var l = Alloy.UI.create("index", "Label", {
title: "sometext",
classes: ["header"],
});
Where "index" is what being generated by Alloy from you app.tss file.

Convert from Extjs 4.0.7 to Extjs 4.1

I have been developed one application in extjs 4.0.7. and now if i want to use extjs 4.1. for further implementation of that application.
Is it possible? Plz help me, if answer is yes.
Thank you
Of course an upgrade is possible. Replace your extjs scripts (ext-all.js etc) from 4.0.7 to 4.1. In most cases you should not face any problem as this is mostly a performance focussed release. http://www.sencha.com/blog/whats-new-in-ext-js-4-1
Convert from Extjs 4.0.7 to Extjs 4.1.
Yes you can upgrade your application from extjs 4.0.7 to 4.1.1 For that you need to replace your ext-all.js/ext-debug-all.js (for debug purpose) but after replacing you may get few problems related to syntax such as in editor, previously we were using record, instead of that we need to use e.record.
listeners : {
'edit' : function(editor, e) {
var grid = e.grid;
var record = e.record;
}
}
There are some issues with the ext-all.css if you are using any custom images on the panel header. Be wary of it. And also html property in the panel is not working.