Change labels using language drop down in extjs application - extjs

I would like to know is there any functionality through which we can provide a provision to the user to that it can select a language from the drop-down and the whole application labels got converted into the selected language.
For example, on a page, we have a combo box with values English & Dutch. By default, when application load then I am able to fetch browser's language and show application labels in the same. But I want to know, how a user can manually convert an Ext JS application into the desired language.
I have tried google translator but UI not rendered as expected.

My approach for the case is:
I am getting a JSON structure for all the labels based on my language key viz. 'nl' or 'en' from the back-end and then using ViewModel for updating the labels throughout the application.
This method turned out to be the pretty easy and appropriate method. I am able to change the labels without refreshing my application.

Related

Create a from builder using Django

I am fairly new to programming and start my career with Python Django. I already build some basic application and recently came across to use google forms and decided to create application like this.
Where any user can come to certain page and can able to create his own form as per his requirement.
I though of some new features like drag and drop. I wanted to ask if that's somehow possible to drag drop input fields or something like that using Django template system where I can use some simple JS library or if its possible using React as fronted.
So my requirements are quite simple, but I am confused with Django models that what will be the structure of models.
UI should be drag n drop thing. User can select the list of fields available in the inventory. And create his own form.
And on post submission. From django you need to capture and store the data.
Here in this case the data will be the form fields as well as its values.
Ex form fields which are available in the inventory.
Test field
Email Field
Multi select field and
Drop Down Field=
I hope someone can help me so that I can get started and came up with some methodology.

Internationalization of Dynamic content using spring or angularjs

I need a help on doing a internationalization of dynamic content. Let's suppose I have a application which is working in different region like jersey, Philippines, Argentina etc. I need to show content based on the country user's login. I already know how to show it for labels. But for dynamic content, I unable to think how to proceed. For eg. if a user login in a particular region, I need to show his name in that particular region language or If he changes his language preference then need to show based on the selected preference.
I am using spring and angularjs in my application.
How to proceed for this?
I made one angular application with just the requirement you said. i18n and l10n.
angular-translate for dynamic label translations
angular-i18n for localization.
angular-dynamic-locale for dynamic localization.
EDIT EXAMPLE
Simple page http://the-unsoul.github.io/angular-requireJS/#/home (only couple fields got its label tranlating)
Source code https://github.com/the-unsoul/angular-requireJS

How to serve separate page (Orchard template) for phones

Using Orchard 1.8.1 I have written a simple image gallery that displays thumbnails and a lightbox. It is just a template that is driven by an Orchard Projection, using a Shape Layout. Works just fine. However, for phone users there is no point displaying thumbnails and it's better to just display the lightbox (with touch support). So I have also implemented that in a separate template. But how can I get Orchard to switch templates depending on the UserAgent string?
I have tried implementing Theme switching (http://weblogs.asp.net/bleroy/dynamically-switching-the-theme-in-orchard), but it's a really ugly solution when I really want to just replace one view, and still enable implementers to switch themes. This is NOT an issue of styling; it's an issue of changing the content based on the device.
I tried implementing DisplayModeProvider as described here: http://www.campusmvp.net/blog/displaymodes-in-mvc-4. But although the filter was called, it had no effect on view names.
Are Projections problematic here because the shape name is set? Is there a better way to go about this?
Create an alternate when you see a mobile browser, preferably from a shape table provider.

Using intermediate appPage xpages mobile

I have a simple issue, but I don´t how to solve the problem.
Using XPages Mobile controls, I have a document with some actions, and one of them is "Send to Signature".
The workflow is: select the signer of document (from names) and send to signature.
I need to show for the current user, one field to select the signer (I already have a field with typeahead funcion to select him).
I would like to use an intermediate appPage for this, but when I´m in the new appPage, the currentDocument is gone.
How can I use the same document (opening from a dataView) for solve this problem?
Can I navigate between appPages (inside SinglePageApp) using the currentDocument??
Thanks in advance
It might be worth looking at Mobile Value Picker on OpenNTF. The mobile prefix may need setting in XSP Properties to "Mobile_" (or it could be that I messed around with the development version after the last upload). But it gives code to have a button / link to go to a subsequent appPage to select values from a list. It starts from a DataView, to a document, to the selection page.
The project has not changed for a couple of years, but I've just tested it in Chrome setting user agent to Android and it still seems to work fine on 9.0.1 FP2.

How do I get selected date with YUI calendar if no javascript fallback

Please be gentle, I am perplexed I can't figure this out...
I was told to use the YUI library because it is the most accessible library and that it provided fallback when JavaScript was not enabled. I cannot figure out how I would get the selected date for a calendar widget when JavaScript is not enabled. Nothing seems to be posting on submit.I tried to bind to an input box instead of a div but it just ignored the binding.
If JavaScript is enabled I can just push the selected value to an input box.
Is this widget the exception to the rule since it binds to a div or is there a secret way to find out what the user has selected with JavaScript not enabled?
Many YUI widgets are designed to enhance existing HTML, and fall back to something useful even if JS is turned off or broken. For example, a YUI TabView's core markup is a list of links; if you break JS, you still have those working links to click on.
But YUI Calendar is not a form element in and of itself -- instead you should think of it as an enhancer for form elements. Your instinct to attach it to an input element is the correct one. The good news is that the YUI gallery has a popup calendar, built on top of the base calendar, which is designed to bind to elements and appears below the element when the user focuses there.
This is a classic progressive enhancement scenario. If the user has JS, they get a fancy calendar. If not, they can still fill out the plain input field -- no harm done.

Resources