Comments (17)
Forgot to mention, the iRate.bundle is in the 'copy resources' of the project.
from irate.
just for testing, i replaced the current 'localizedStringForKey' method with this older implementation:
- (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defaultString
{
static NSBundle *bundle = nil;
if (bundle == nil)
{
//get localisation bundle
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"iRate" ofType:@"bundle"];
bundle = [NSBundle bundleWithPath:bundlePath] ?: [NSBundle mainBundle];
//get correct lproj folder as this doesn't always happen automatically
for (NSString *language in [NSLocale preferredLanguages])
{
if ([[bundle localizations] containsObject:language])
{
bundlePath = [bundle pathForResource:language ofType:@"lproj"];
bundle = [NSBundle bundleWithPath:bundlePath];
break;
}
}
//retain bundle
bundle = [bundle ah_retain];
}
//return localised string
return [bundle localizedStringForKey:key value:nil table:nil];
}
And it works, even though it's ignoring the defaultString.
I suppose there's a bug somewhere in the current implementation, but i don't know where exactly.
from irate.
Have you added a Localizable.strings file to your project and made sure that Portuguese is selected as a supported language in Project > Info?
If so, try doing a clean build from the Product menu - it may just be that you have a previously cached strings file from the old version.
from irate.
I had not.
I thought that was only required if i wanted to add/customize the localizations in the iRate bundle.
I've now added an empty Localization.strings, but i can't find the place where i'm supposed to select the supported languages (and do i have to manually add each of the languages supported by iRate? that doesn't seem to make sense to me).
In the Project->Info i just get the info that's in the app bundle. Is it there that i should edit?
I've read some people saying i should click on the Localization.strings, file inspector, and click on the "+" in the Localization, but there's no "+" in this version of Xcode (4.5). And it only let me add English as language.
from irate.
It used to be the case that iRate would be localised to all supported languages even if your project was not, but this is not what most people would want. Is it really the case that you have no text in your app that needs to be localised apart from iRate?
Here is a tutorial that includes screenshots of how to add new languages: http://www.aboveground.com/blog/xcode-4-4-and-localizable-strings-no-way-to-add-language
Note that this is the Info tab under Project, not under Targets.
from irate.
Ah yes, just found the right Info tab and it's working. Thank you for your help.
Yes i would like to localize my project, but not now, and i certainly wouldn't be able to localize it now to the many languages iRate supports. I think it's a bit of a hassle that iRate depends on that, but that's just my opinion.
from irate.
And i think, but i'm not sure, that iTunes will show to users that my project is localized to all those languages even though it's not, it's just iRate. But i'm not sure.
I don't know, i'm thinking about keeping locally the old implementation.
from irate.
The reasoning was that it's a bit odd to have mixed content in an app. If the rest of the app is in English, one particular modal should not be displayed in Russian, or whatever.
from irate.
It is true that iTunes will display all the languages you've added, but the idea is that you should only add support for the languages that you intend to localise your whole app for, and ignore the other ones that iRate supports.
from irate.
Really? I don't think it's odd at all. But maybe i'm wrong, i'll think about it for while.
For me it's like: there's the app, and there's iRate. As if iRate was a separate thing, almost like a native iOS dialog. The app can be english-only, but iOS is localized, and that's how iRate presents itself. It even looks like a native dialog.
And between connecting with the users in their own native language -- despite the app's english-only --, and being consistent about the language used, i think connecting with the users is more important.
from irate.
I may be able to add it back as an option. I'll think about it.
The previous solution was a pretty nasty hack, requiring me to basically bypass the standard localisation mechanism, pre-compile strings into binary plists, etc. The new solution is much cleaner and more compatible with how Apple intends it to work.
from irate.
I agree the old solution is more hack-ish. But what you get in the end is much better. I thought about it a little and i definitely think it was better before.
There are many examples of mixed languages in interfaces: if the app uses twitter/facebook sharing from iOS, it's going to appear localized. If it uses iOS stock buttons, they're going to appear localized. No matter what language the app is showing.
So basically, iRate should use whatever iOS is using. But i guess there's no API for that, and in that case, the old implementation at least gave the same results as if there was one API.
from irate.
OK, I have a solution that should work. Give me a little while.
from irate.
Sure. I must say the project, as it is, is really great.
Just thought i'd give my 2 cents about this new localization thing.
from irate.
OK, check out version 1.5.5. I think I've found a solution that should suit everyone.
from irate.
That worked great. Thanks, man.
from irate.
FYI, I've renamed 1.5.5 to 1.6, but it's the same code, in case you were wondering.
from irate.
Related Issues (20)
- iRate will be allowed for iOS 11? HOT 2
- useSKStoreReviewControllerIfAvailable is ignored HOT 4
- Significant event issue? HOT 5
- SKStoreReviewController is not used in manual prompt request HOT 2
- Use `+initialize` instead `+load` to instantiate iRate singleton HOT 3
- Submit button disabled on SKStoreReviewController HOT 4
- Localizations bug with Chinese simplified and traditional
- iOS 11 problem with opening app page in the App Store HOT 20
- Can you add prompt to update on new version available HOT 2
- How should I reset iRate totally?
- iRate Not show HOT 1
- Show Review Alert only if user has not submitted any review?
- ratedThisVersion not set if using SKStoreReviewController? HOT 4
- iOS Swift : Message and Message Title are not working
- iRate Delegates are Not getting Called
- iOS 11 (GM) prompts at launch even though promptAtLaunch set to NO & Submit button fails HOT 8
- Crash when sending `window` message to `UIApplicationDelegate`
- 您好,为什么弃用不维护了啊? HOT 2
- iRate did not prompt for rating because the app was first used less than 10 days ago HOT 1
- SwiftPM Support / swift package init
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irate.