Pass localization not working after fields push
See original GitHub issueHi,
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:
- Created 4 years ago
- Comments:24 (14 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apple Wallet pass is pure macOS/iOS files, so, they know nothing about Windows. Path separator in Pass must always be ‘/’
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 changedexamplePass
toPass
.I also edited examples model
examplePass
to not havegeneric: {}
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. 😉