Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid LocaleReference .language(en) #780

Closed
KKirsten opened this issue Dec 6, 2022 · 2 comments
Closed

Invalid LocaleReference .language(en) #780

KKirsten opened this issue Dec 6, 2022 · 2 comments

Comments

@KKirsten
Copy link

KKirsten commented Dec 6, 2022

I updated to Swift 7.2.0 and added Rswift as a Xcode Plugin. Code generation seems to work however the generated code does not compile.

Xcode complains: Cannot find 'en' in scope in the following line:

var appIntentVocabularyPlist: RswiftResources.FileResource { .init(name: "AppIntentVocabulary", pathExtension: "plist", bundle: bundle, locale: .language(en)) }

It seems like .language(en) should be .language("en") instead.

My guess is that LocaleReference+Generator.swift line 18 should be:
return ".language(\"\(string)\")" instead of return ".language(\(string))"

AppIntentVocabulary is a localized file without a Base Localization. Adding Base Localization to the file does not fix the issue for me since the generated code still contains .language(en) instead of .base

@tomlokhorst
Copy link
Collaborator

Thanks for the report, and for finding the exact location in the code that's the problem!

I've fixed this in the 7.2.1 release.

@KKirsten
Copy link
Author

KKirsten commented Dec 6, 2022

Thanks for the quick fix. Works now fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants