Giter Club home page Giter Club logo

Comments (9)

gwynjudd avatar gwynjudd commented on August 9, 2024 1

I'm trying to track down a similar issue. I've got it narrowed down to the following circumstance, and I wonder if you are seeing the same thing.

Basically, what I'm seeing is that "sometimes" (haven't worked out the exact situation) a build will work correctly and the generated xcode project will contain the expected localizations:

image

But "other times", the build will not work correctly, and the generated xcode project will not contain the expected localizations:

image

The two screenshots are taken from builds that were run at different times on our build server. They are from different branches, but there aren't any relevant changes to localizations or that kind of thing that I can identify. I have seen the same situation occur for me on my own development environment from time to time, but hadn't really had the opportunity to dig into it. Please treat this as evidence that "something weird" is going on.

Here is some excerpts from the build logs for the above two builds, that I think are relevant.

First, from the one that "worked correctly":


Updating ios **** to use workspace.

> [email protected] add-strings /Users/****/jenkins-slave/workspace/Touch_iOS_Shell_releases_iOS_6.1
> npx cordova plugin add https://github.com/gwynjudd/cordova-plugin-localization-strings#utf --fetch --nosave

Installing "cordova-plugin-localization-strings" for ios

> [email protected] prepare:ios1 /Users/****/jenkins-slave/workspace/Touch_iOS_Shell_releases_iOS_6.1
> npx cordova prepare ios

...

====== Assets moved from ./scripts/ios/AppDelegate.m to ./platforms/ios/StayinFront Touch/Classes/AppDelegate.m ======
====== Assets moved from ./scripts/ios/AppDelegate.h to ./platforms/ios/StayinFront Touch/Classes/AppDelegate.h ======
====== Assets moved from ./scripts/ios/exportOptions.plist to ./platforms/ios/exportOptions.plist ======
====== Assets moved from ./scripts/ios/adhocOptions.plist to ./platforms/ios/adhocOptions.plist ======
====== Assets moved from ./scripts/ios/phonegap.js to ./platforms/ios/www/phonegap.js ======
new pbx project written with localization groups
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Customize app title)
[Pipeline] withEnv

Note the key string above "new pbx project written with localization groups". This string is found here (

console.log('new pbx project written with localization groups');
).

Now follows similar excerpt from the build that didn't work correctly:

Updating ios **** to use workspace.

> [email protected] add-strings /Users/****/jenkins-slave/workspace/Touch iOS Shell 6.0/iOS
> npx cordova plugin add https://github.com/gwynjudd/cordova-plugin-localization-strings#utf --fetch --nosave

Plugin "cordova-plugin-dialogs" already installed on ios.

> [email protected] prepare:ios1 /Users/****/jenkins-slave/workspace/Touch iOS Shell 6.0/iOS
> npx cordova prepare ios

...

====== Assets moved from ./scripts/ios/AppDelegate.m to ./platforms/ios/StayinFront Touch/Classes/AppDelegate.m ======
====== Assets moved from ./scripts/ios/AppDelegate.h to ./platforms/ios/StayinFront Touch/Classes/AppDelegate.h ======
====== Assets moved from ./scripts/ios/exportOptions.plist to ./platforms/ios/exportOptions.plist ======
====== Assets moved from ./scripts/ios/adhocOptions.plist to ./platforms/ios/adhocOptions.plist ======
====== Assets moved from ./scripts/ios/phonegap.js to ./platforms/ios/www/phonegap.js ======
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Customize app title)
[Pipeline] withEnv

Note that the key string doesn't appear. Without this code running (

console.log('new pbx project written with localization groups');
), the project doesn't get updated.

from cordova-plugin-localization-strings.

rodrigograca31 avatar rodrigograca31 commented on August 9, 2024

I can't help you much since I know nearly 0 about iOS but you say the file is in the right location.....
and isnt the --device flag to run on the device? (at least it is for Android)

if you do cordova run ios --device (or without --device) does it work?
(to check if its an issue related to the release build process...)

from cordova-plugin-localization-strings.

gwynjudd avatar gwynjudd commented on August 9, 2024

More detail, here is a screenshot showing the generated project and resources folder with localizable strings as expected in the build that worked correctly:

image

Versus, in the build that did not work, the resources folder does not contain the localized string files:

image

from cordova-plugin-localization-strings.

gwynjudd avatar gwynjudd commented on August 9, 2024

More detail on this. I found that for the build that worked OK, I am getting this message at the point of installing the plugin:

Updating ios **** to use workspace.

> [email protected] add-strings /Users/****/jenkins-slave/workspace/Touch_iOS_Shell_releases_iOS_6.1
> npx cordova plugin add https://github.com/gwynjudd/cordova-plugin-localization-strings#utf --fetch --nosave

Installing "cordova-plugin-localization-strings" for ios

> [email protected] prepare:ios1 /Users/****/jenkins-slave/workspace/Touch_iOS_Shell_releases_iOS_6.1
> npx cordova prepare ios

Key point being this message Installing "cordova-plugin-localization-strings" for ios.

For the build that fails, I get a different message:

Updating ios **** to use workspace.

> [email protected] add-strings /Users/****/jenkins-slave/workspace/Touch iOS Shell 6.0/iOS
> npx cordova plugin add https://github.com/gwynjudd/cordova-plugin-localization-strings#utf --fetch --nosave

Plugin "cordova-plugin-dialogs" already installed on ios.

> [email protected] prepare:ios1 /Users/****/jenkins-slave/workspace/Touch iOS Shell 6.0/iOS
> npx cordova prepare ios

Note the message is different Plugin "cordova-plugin-dialogs" already installed on ios..

from cordova-plugin-localization-strings.

rodrigograca31 avatar rodrigograca31 commented on August 9, 2024

🤔 the plugin uses after_prepare but it should work according to the docs https://cordova.apache.org/docs/en/latest/guide/appdev/hooks/

why is it installing it? does your build thing always installs everything from scratch? instead of just running the project?

also, in latest versions of cordova they started saving plugins in package.json and config.xml, try to remove the plugin completely from the project and from both files (you might have to do it manually) and then reinstall again........
https://cordova.apache.org/news/2017/05/04/cordova-7.html

Good luck, I can't help much more as Im not familiar with iOS

from cordova-plugin-localization-strings.

gwynjudd avatar gwynjudd commented on August 9, 2024

The build is running in jenkins so it has to do at least a cordova prepare before being able to build. Doing cordova plugin add for this plugin seems to help with getting it to work correctly.

If I still see the issue, I'll try to change the build so that it doesn't add the plugin each time and see if that helps or hinders. But for now I've managed to do some stuff to work around it.

from cordova-plugin-localization-strings.

rodrigograca31 avatar rodrigograca31 commented on August 9, 2024

@gwynjudd is this still an issue?

from cordova-plugin-localization-strings.

gwynjudd avatar gwynjudd commented on August 9, 2024

@rodrigograca31 not for me. I had put in some work-arounds a while ago that seems to have helped. From my side it is probably ok to close this issue - if I get time (hah) I may remove the work-arounds and see if it reappears.

from cordova-plugin-localization-strings.

rodrigograca31 avatar rodrigograca31 commented on August 9, 2024

👍

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.