No way to handle internationalization (i18n)? - internationalization

I'm wondering if there is any way to handle i18n while building HTML/Js apps using trigger.io (forge).
By the way, there is also no way to detect user's locale on devices, workarounding by inspecting User Agent ( or in my case - a FB connect app - asking FB to get the user's locale)
Internationalization is a must have for any serious app ...
I'm currently "hacking" this by creating several JSON files (one per locale), holding same keys in the appropriate language.
1: Is there any plan of detecting/getting user's locale with forge Js API ?
2: Is there any plan to handle automated i18n while building apps ?
Tks.

You could easily write a Trigger.io plugin to detect the device language for you. Here are some resources on how to do this:
Android: http://developer.android.com/reference/java/util/Locale.html
iOS: Getting current device language in iOS?
As soon as you have the language string you could then use one of many js plugins that handle localization for you OR do it on your own. Having multiple json files with the localized strings and loading one of them on demand doesn't sound too hacky to me.
PS: Of course, if you plan to have a mobile browser version of your app you cannot rely on native plugins. In this case you'd have to use a different solution. Take a look at JavaScript for detecting browser language preference.

There are two things to translate: your JS/HTML app and the native elements.
JS/HTML
Use window.navigator.language to get the locale.
Use some library, e.g. https://github.com/wikimedia/jquery.i18n
Native
The native elements aren't shown that often, but do contain some crucial things, such as permissions dialogs ('The app wants access to your photos').
There is currently no support in trigger.io for translating this section that I know of, i.e. they will all be in english.
But as I understand it trigger.io could add support for this fairly easily, by just making it possible to 'switch' on more languages in config.json, since there are already translations for these dialogs built into iOS, just a matter of 'flagging' an app as having support for the language.
Again, I'm not 100% sure on the native part, but this is how I think it works.

Related

Is it possible to build mobile and web apps from the same code base?

Is it possible to have a single code base for a mobile(ios/android) and web application? I'm thinking about using react native or angular/nativescript. If you have attempted this what are the things to keep in mind before doing this. Also anything particular to for SEO?
Most importantly are there any real world apps with reasonable complexity that already have done this?
NativeScript actually supports this a couple different ways.
NativeScript officially supports Angular; so you can create everything as an Angular application. Almost the entire app can be shared between Web and NativeScript; the only things that can't is the actual screen layout. In Angular for the Web; you use HTML tags so it might be somepage.html <div>{{somevalue}}</div> and for the NativeScript side you would have somepage.xml and it would have <Label text="{{somevalue}}"></Label>. This allows you to layout the app using the native components for Mobile, and web components for browsers, but use the same backend logic.
There are several seeds and platforms that are designed around fully creating a web app and a NativeScript mobile app that can share virtually everything.
NativeScript also supports VueJS; in this case you can again create virtually everything that shares much of its code base, the only thing is again you need separate layout files because again the web uses html, and NativeScript uses native components. So you have to have separate display files.
Disclaimer: I also work for nStudio; I tend to do non-angular type plugins mainly; but I do know that xPlat is really state of the art and has been used in several successful applications that our development studio has produced.

Convert server-generated site to PhoneGap/Cordova app?

What's the lowest effort way to get a site with server-generated pages (in my case Laravel/PHP) running as a PhoneGap/Cordova app? I'd rather not have to convert the whole thing into a single page app before importing into PhoneGap/Cordova.
Is it possible to use PhoneGap/Cordova as a very thin wrapper and still load each page live from the server? And if so, how exactly please? I don't think we need any native phone APIs.
Reason for the whole thing is my client insists on "having an app" even though obviously our site will work in a mobile web browser and can have an icon on the user's phone.
Many thanks
Unfortunately for your app to pass Apple App store approval it will have to provide some basic functions and display correctly without an internet connection. This means at a minimum, if you plan to generate content on a server you will probably need the Cordova plugin for network information:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/
I would make sure you are familiar with the Apple Human Interface Guidelines:
https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/
You will probably also need to bundle any JavaScript. Apple is very picky about apps that download code (this can include JavaScript).
This is a section from the iOS developer Agreement.
3.3.2 Except as set forth in the next paragraph, an Application may not download or install
executable code. Interpreted code may only be used in an Application if all scripts, code and
interpreters are packaged in the Application and not downloaded. The only exceptions to the
foregoing are scripts and code downloaded and run by Apple's built-in WebKit framework or
JavascriptCore, provided that such scripts and code do not change the primary purpose of the
Application by providing features or functionality that are inconsistent with the intended and
advertised purpose of the Application as submitted to the App Store.
The following is my opinion only
My fear is that if you go at it in a low effort way, best case you will fail app approval. Worst case it will leave users with a poor experience or worse, a poor image of your client. Do it properly and give the app some extra functions that you can't have in a browser alone. I would advise your client of this and see if they would like a proper app that engages their customers and provides them with a great experience.

Using nativescript-ng2-magic

I have a question. I wanted to start implementing a web (desktop) app and, with almost the same code base) with nativescript the native app for iOs/Android.
My question is, I have already implemented the native app, can I use the nativesript-modules (like color, ui/page, etc.) also for the web app?
Thank you in advance
You can't use those.
I think nativescript-ng2-magic and advanced-angular-seed (same author) are made to be used the other way around.
You have to refactor your services to be platform agnostic (as they should be) and the custom Component decorator takes care of switching templates. If you have lot of accessing nativescript-modules in your component's code, the switch is not going to be easy.

Where to find default text for supported languages in WP7

I am creating an application, and I noticed that nowhere can i find text such as 'pin to start' to use for livetiles in my application (creating a secondary tile). I tried to send Microsoft's AppHub a support ticket, but I only received a response saying that I could not be helped with translations? I clearly stated the need to be standardized and uniform across my third party apps and default behavior, but this had no effect on the answer. My problem arises when I translate my applications using a resx translator tool and Bing for my translation service. Some words to not translate correctly, which is fine because I go back through to check and then attempt to do this manually, but phrases such as 'pin to start' which are so unique to the WP7 application list sometimes do not translate properly at all. I would like to be as close to Microsoft's default language translations as possible for supported display languages, but are there any resources which may help me out? Or am I left in the dust to try to figure these out myself?
There is a page Microsoft Terminology Collection where you can download sets of standard texts.
There is no document that will show you the localized versions of the system strings. For that, you will have to dig through OS files, and that implies that you will have access to the WP OS image. You have to rely on your own translation skills or simply switch languages on the phone to check specific strings.

Best way to approach WP7 app development?

I have some knowledge of basic PHP developing however right now I am thinking about developing a phone app. I do however have a bit of a conundrum in that I love WP7 and I have so many ideas for features which can't be done on iOS and Android, however at the same time I am completely aware that my target users (filmmakers) generally have iOS or android phones.
Is there a way I can develop the app, which I will get a developer to do rather than myself, with WP7 as the lead platform and then make a relatively simple conversion to the other platforms or do apps generally have to be completely reworked for each platform?
Also, just to though it out there, any idea of where to go to find a freelance app developer?
Thanks
James
I think you have a few options, but the first question I would have is: where comes the data from. Are you the owner of the data, and do you already have a datasource from where you can get the data from? If not I would suggest take some time to write a decent 'backend' from which the different platforms easily can get the data from.
Also all different platforms have their own pro/cons which you cannot share that easily. If you build a WP7 app in silverlight/xna, you cannot directly port it to a ios/android variant, also functionality will probably look/react different. You will need different solutions foreach platform with this approach.
Another option would be to use an platform like phonegap which can create a solution that will work on multiple platforms. (It uses HTML5 to get it work on the different platforms)
Build your app on iOS and android first, and when you have an app to base WP7 development then contact a developer that has made similar apps to yours.

Resources