question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass localization not working after fields push

See original GitHub issue

Hi, I am setting the pass fields dynamically from code and then trying to localize the labels. I do not have lproj directory created as the media is still the same. My pass.json has passtype as generic : {}

I am setting values as

examplePass.primaryFields.push({
        "key" : "coupID",
        "label" : "CoupId_localized",
        "value" : "testid"
      });

Then localize as follows for french

examplePass.localize("fr", {
      "CoupId_localized": "Copon num_FR"
    });

examplePass.localize("en", {
      "CoupId_localized": "Copon num"
    });

The file gets dowloaded but its corrupted.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
tinovyatkincommented, May 23, 2019

Apple Wallet pass is pure macOS/iOS files, so, they know nothing about Windows. Path separator in Pass must always be ‘/’

1reaction
alexandercerutticommented, May 21, 2019

Okay, no problem. I understand that passes may contain confidential infos but I request passes only for debugging purposes and delete them once the issue is closed.

I took one of the examples (barcode.js), and replaced the code from Line 31 to Line 72 with the code you passed me (primary fields and localization) and changed examplePass to Pass.

I also edited examples model examplePass to not have generic: {} as you told me.

Yeah, the download usually happen correctly even if the mime-type is wrong. A test you can try to do is to open up in a Mac or PC and rename it to .zip. If it opens correctly, the pass is well composed but might have other internal problems (some violated rule for example).

Also, if you have a Mac (thing that I don’t have right now), you can connect your iPhone via USB and open Console.app (/Applications/Utility/Console.app). You’ll be able to see iPhone logs, also the ones when you try to open a non-valid Pass. You can filter your log search for “Passkit”.

I don’t see anything wrong with your pass.json

I’ve edited your comment to look better at the code. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

SwiftUI Localisation not working with @State Strings
Everything works fine but I'm having issues with localising @State var. Localisation is not working and I'm getting only the keys printed out....
Read more >
Adding field localization later to the model - Builder.io Forum
I found an issue, with custom field level localization. Currently my data model does not support localization, here is the model:.
Read more >
Localizing strings that contain plurals - Apple Developer
Use a strings dictionary file to ensure correct localization of strings that ... enter strings in the Filter field, select Stringsdict File, and...
Read more >
Localize your app - Android Developers
Whenever the app runs in a locale for which you have not provided locale-specific text, Android loads the default strings from res/values/ ...
Read more >
Languages of passes - Passcreator Knowledge Base
This means that there's not direct reference between the string in a field in the default language and the translated version of it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found