Giter Site home page Giter Site logo

Comments (5)

kelvinhokk avatar kelvinhokk commented on June 16, 2024

hi gitito, i have not tested with phonegap before, only cordova. In fact, the node scripts I used, reply on a cordova context like:

var path = context.requireCordovaModule('path');

I will try to make it work with phonegap when i get the chance.

from cordova-plugin-localization-strings.

kelvinhokk avatar kelvinhokk commented on June 16, 2024

hi gitito,

I wasn't able to reproduce the error on Node 7.9.0, PhoneGap 6.5 and iOS 4.3.0 (I tried using a fresh nvm install of Node 7.8.0 and Node 6.8.0 too). I am running Mac OS X 10.12.4. I have not tried running the plugin on Windows nor Linux. Could it be a OS problem?

I did this:

nvm install 7.9.0
nvm use 7.9.0
npm install -g phonegap@latest
phonegap create phonegap-hello --template hello-world
cd hello-world
...
[copy and mkdir the translations folder with the json files here]
...
phonegap plugin add  cordova-plugin-localization-strings --fetch
phonegap platform add [email protected]
phonegap build ios -d

Basically I was able to build. The phonegap build logs show:

�[36m[phonegap]�[39m executing 'cordova build ios -d ' ...
No scripts found for hook "before_build".


No scripts found for hook "before_prepare".


Checking config.xml for saved platforms that haven't been added to the project


Checking for any plugins added to the project that have not been installed in ios platform


No differences found between plugins added to project and installed in ios platform. Continuing...

Generating platform-specific config.xml from defaults for iOS at /Users/kelvinho/work/phonegap-apps/phonegap-hello/platforms/ios/helloworld/config.xml

Merging project's config.xml into platform-specific iOS config.xml


Merging and updating files from [www, platforms/ios/platform_www] to platforms/ios/www

  copy  platforms/ios/platform_www/cordova_plugins.js platforms/ios/www/cordova_plugins.js (updated file)

Current launch storyboard undefined

Not changing launch storyboard setting.

Wrote out iOS Bundle Identifier "com.phonegap.helloworld" and iOS Bundle Version "1.0.0" to /Users/kelvinho/work/phonegap-apps/phonegap-hello/platforms/ios/helloworld/helloworld-Info.plist


iOS Product Name has not changed (still "helloworld")

Updating icons at platforms/ios/helloworld/Images.xcassets/AppIcon.appiconset/

Updating splash screens at platforms/ios/helloworld/Images.xcassets/LaunchImage.launchimage/

Prepared iOS project successfully

Executing script found in plugin cordova-plugin-localization-strings for hook "after_prepare": plugins/cordova-plugin-localization-strings/scripts/create_ios_strings.js

Resolving module name for path => path

Resolving module name for q => q

Resolving module name for glob => glob


Resolving module name for q => q

Resolving module name for path => path

Resolving module name for glob => glob

new pbx project written with localization groups

...
[more build logs]
...

from cordova-plugin-localization-strings.

fishkingsin avatar fishkingsin commented on June 16, 2024

I have same problem when using

node 4.4.7
npm 2.15.8

from cordova-plugin-localization-strings.

fishkingsin avatar fishkingsin commented on June 16, 2024

node 4.4.7
filesystem works with file path(string) only

function writeStringFile(plistStringJsonObj, lang, fileName) {
    var lProjPath = getTargetIosDir() + "/Resources/" + lang + ".lproj";
    fs.ensureDir(lProjPath, function (err) {
        if (!err) {
            var stringToWrite = jsonToDotStrings(plistStringJsonObj);
            var buffer = iconv.encode(stringToWrite, 'utf16');
            var filePath = lProjPath + "/" + fileName;
            fs.open(lProjPath + "/" + fileName, 'w', function(err, fd) {
                if(err) throw err;
                fs.writeFileSync(filePath, buffer);
            });
        }
    });
}```

from cordova-plugin-localization-strings.

kelvinhokk avatar kelvinhokk commented on June 16, 2024

Hi Fishkingsin,

Thanks for the feedback, I finally reproduced the error in a node 4.x.x environment (even 4.8.3).

I have tested again on several Node environments and found that the minimum requirement for this plugin is:

node 5.0.0
nom 3.3.6
cordova 6.0.0

Perhaps you can install nvm and change node environments and try the plugin again?

from cordova-plugin-localization-strings.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.