Smartling / ios-i18n

The ios-i18n library provides seamless integration of plurals into iOS 6 apps.
http://www.smartling.com
Apache License 2.0
205 stars 36 forks source link

cannot import into swift project #24

Closed jumpingfrog0 closed 9 years ago

jumpingfrog0 commented 9 years ago

I import it into my swift project in X-Bridging-Header.h, but cannot build successfully image

What did I do wrong?

paiv commented 9 years ago

@jumpingfrog0 hi, The library is not ready for Swift as-is, currently you need to link against SmartlingLib target; you have two options, either:

jumpingfrog0 commented 9 years ago

@paiv Thanks. I try the first option, but swift don't support macros so that can't call functions such as SLPluralizedString. I wrote some generic functions with swift as same as the macros that you declare in SLLocalization.h, but it crash when I call those. I doubt I made some mistakes. Finally, I use another libary: TTTLocalizedPluralString The library is also not ready for Swift, so I did the same thing as above and it worked fine. Unfortunately, it only support Int. I will try to make Smartling.i18n support to swift if I am free.

paiv commented 9 years ago

@jumpingfrog0 would you consider using .stringsdict format -- they have plurals, and Swift support out of the box?

jumpingfrog0 commented 9 years ago

@paiv Thanks.Good idea.