How to handle string localisation in jQuery mobile? - javascript

I am making an android app using phonegap and jQuery mobile.The app will also have option for displaying text in other languages like Tamil,Kannada and Telugu.I want to change all the text displayed when the user clicks on these options for changing the language. What is the best way to do that?

I would look at i18next, a JS library that runs entirely in browser and whose localizations are stored in JSON. It works with jQuery and has several other nice features. Seems like it would cover your needs.

I'm running a Application which supports around 5 European languages. I manually created a language file in the format of JSON. I wrote custom functions to replace the UI element's labels in a separate file which triggers when a page loads.
It just works fine for me.

check out the HTMLed.js framework for jquery mobile localization on GitHub link

Related

Advansed xlsx spreadsheet formatting

Is there some JavaScript or Golang lib that allows to create xlsx files using some custom heavy formatting?
I'm working on an Electron app and want to generate some reports but
the most popular library doesn't provide cell formatting, that fork looses the ability to define page properties like margins and page orientation and that Golang lib as I see doesn't provide page properties too.
Can anybody show some good alternatives or show me I'm wrong?
(no C-like langs and Python please)
I am myself looking for something similar to format docx documents and I have just started trying out gooxml.
Currently it has following capabilities for Excel:
Read/Write/Edit
Cell formatting including conditional formatting
Cell validation (drop down combobox, rules, etc.)
Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel)
Formula Evaluation (100+ functions supported currently, more will be added as required)
Embedded Images
All chart types
Edit to answer comment:
As stated in the documentation, you may have to fall back to raw document manipulation should the library's API not cover a specific use case.
See CT_PageMargins.go and CT_PageSetup.go for margin and orientation...
Well it seems I've learned the lesson - after trying to use "super-hard-to-understand-and-use" jsreport-xlsx module I've remembered about one lib that didn't worked in Electron renderer and tried it to work from Electron main process.
And it works! Sometime it may be a little treaky to make it create doc exactly you want but it's much better than XLSX-style I've used before and have all features I want.
(it's second [and last I believe] time I've forget about Electron renderer is not Node.js, the true Node.js is main process)

Attach PDF to PDF as attachment (not as a page) via Javascript in HTML (not in Acrobat)

I would like to generate a PDF portfolio using JS from an HTML/CSS page on a local machine. I would use a PDF template file which includes a PDF portfolio Navigator in SWF form. I have successfully accomplished this using C# and a command line program, but can not identify the proper Javascipt components to do this browser-side or pseuo-server with Node.js. Basically, I am looking for something which will allow me to append a PDF to a new or existing PDF via configuration choices and an 'assemble' action using a JS or HTML button. iTextSharp provides the required PDF interaction functionality, but I can not figure out to run this inside an HTML to allow configuration via the HTML/CSS DOM (i.e. checkboxes, text field desciptors, etc...). Does a library with this type of functionality exist?
So you want to create a PDF using JavaScript?
On a quick google search, I found what appears to be a javascript library for creating and manipulating PDFs call jsPDF
If you want information on how to upload files with JavaScript alone, here is an article on how to do that. It also shows you how to use the file element.
For style, I recommend using a CSS Framework is you don't know much about CSS. I personally use Twitter Bootstrap for quickly prototyping things. It's quick and easy, and has good documentation. You can also use this to see how to make a form in HTML. I haven't got any good starter tutorials for HTML off the top of my list, sorry.
If you don't know much about JavaScript, when it comes to getting the options from the form, so that you can use them as configuration options, I'd suggest using the jQuery framework. It'll help you get up and running quickly enough
Note, all of this shouldn't replace basic training in JavaScript and HTML/CSS. Frameworks make things simpler, but if you don't know how to do something without a framework, you're going to have a hard time with a lot of the more complicated things. This goes for every language

Convert Existing web application UI into responsive web application

I have single page ajax web application. All HTML structure build dynamically through pure javascript or jQuery. Now i want to convert this existing web app to responsive application. I had searching on google but i can not get it specific flow to do this. I also see lots of css framework like bootstrap,foundation,etc. Is those help to get out from this? if yes then How? My target resolution is 800*600 to 1920*900.
You can use Bootstrap, just include the files - CSS should be enough if you want just the responsiveness, or try Initializr - get the right template and copy your existing code into it.
You can also look into the FriendlyURLs feature in ASP: http://www.hanselman.com/blog/IntroducingASPNETFriendlyUrlsCleanerURLsEasierRoutingAndMobileViewsForASPNETWebForms.aspx. This will let you create mobile versions of the pages in your site.
If this is not your goal and if you are OK with commercial software, you can try the RadPageLayout control from Telerik: http://www.telerik.com/help/aspnet-ajax/page-layout-overview.html. Check it out here: http://demos.telerik.com/responsive-web-design-aspnet/.
Responsive web applications can be created by using CSS media queries. Please find below helpful link http://webdesignerwall.com/tutorials/responsive-design-in-3-steps wich provides overview of responsive approach with screenshots and demo
Good Luck!
Telerik offers yet another way to make your ASP.NET pages responsive via the PageLayout control http://www.telerik.com/products/aspnet-ajax/responsive-page-layout.aspx.
The following responsive web site is made with it: http://demos.telerik.com/responsive-web-design-aspnet/

how to use code igniter for iframes

does code igniter provide css or javascript to help make iframes and web pages within webpages? Any suggestions on how to go about doing this in CI? I need to make a menu that when you put your mouse over it, the button while drop down other buttons. The when you click the corresponding button the iframe below populates from the database.
No, CodeIgniter does not provide any help on Javascript manipulation. It is a PHP framework. Server based, not oriented toward client interfaces.
EDIT :
Since, this has been downvoted, let me quote official CodeIgniter documentation.
Javascript Class : Note: This driver is experimental. Its
feature set and implementation may change in future releases.
With link provided : documentation.
Plus, I have downloaded the latest version 2.0.2. It does not contain any css nor javascript files. (Except for their documentation).

Multiple file selection for an upload control

I was trying to do something like this: http://www.element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html
But in my search for information I found that is not possible to perform multiple file selection with simple HTML and JavaScript (and JSP in the server side). There is a way to do this without using Flash? A third party component you could recommend?
Thanks.
Actually according to the specification, normal HTML file upload fields are supposed to be multiple-file-upload fields. Opera supported it for a bit, allowing you to ctrl-click to select multiple files from a file picker. But it almost always broke the webapp since many web frameworks didn't know about it and would fall over.
In the meantime, it usually suffices to use JavaScript to add an extra file upload field to the form when the previous one has been filled in. This can be made gracefully-degrading for non-JS UAs, whilst sprucing up the management of multiple files with script and pretty icons.
If you go with a Flash uploader, it's a good idea to back it up with a simple HTML file upload field for compatibility there too.
It is still works via flash, but the YUI Uploader component allows you to add multiple file selection with minimal knowledge of flash - the API to interact with it is purely javascript.
HTML 5 will support multiple file upload, but that is not currently well supported in a large number of browsers

Categories

Resources