I hit my head against a wall for 2 days trying to add local localization to my application. The application uses PhoneGap 1.1, and I'm trying to create it using Xcode 4.1
I was looking for information / tutorial / everything starting from 2 days, but I could not find anything detailed. Thus, either this is a trivial problem, and I cannot understand it, or it is an unusual problem.
Many of the streams I saw explain that I have to create a new folder in the Resources section and add the following folders to the project (let's say I want my application to be localized in French and for non-French speaking countries):
- locales
--- en
---- local.strings
--- fr
---- local.strings
Now I have problems: firstly, what should I consider as my project root folder? All of my code is in the www folder, and as I understand it, this main node PG looks when it does its job. Therefore, I assume that I need to create "locales" under "www".
Assuming this is the right place, I should enter key-value pairs in the .strings file. Now, how can I tell Xcode which lines to look for on my index.html page? In Objective-C, this is done by calling NSLocalizedString(@"StringKey")
, but since I use PG, I have either plain HTML or JS to use. Is there a built-in method for this?
Is this the wrong approach? Any hint, tutorial, documentation, reference on this issue will be very useful.
source share