icerockdev / moko-resources

Resources access for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
1.08k stars 120 forks source link

iOS Localized Strings using objC reserved keyword #763

Closed cal-truli-ios closed 2 weeks ago

cal-truli-ios commented 2 weeks ago

I have a list of countries that are keyed by their country code in my strings localization file: Screenshot 2024-09-06 at 9 42 17 AM

the resulting resource file in ObjC will not compile because the keyword 'NO' is reserved by the language: image

Are there any solutions / alternatives to the way Moko creates the resource keys for iOS?

Alex009 commented 2 weeks ago

i think this should be reported to Kotlin team in https://youtrack.jetbrains.com/newissue?project=kt because it's Kotlin/Native responsibility to mangle names that can conflict with ObjC.

while it not fixed i can suggest only to switch resources visibility level from public to internal - in this case MR will not be exposed to objc interface

cal-truli-ios commented 2 weeks ago

That solved my issue! thanks for the assistance :)