onesky / plugin-ios-ota

Over the air plugin
50 stars 8 forks source link

Keys not found even after translations are downloaded. #17

Closed pwightman closed 8 years ago

pwightman commented 8 years ago

Hi!

First of all, thanks for the sweet plugin! I'm excited to use it. I'm having trouble getting the downloaded translations to show up in the app, though. For context of the following snippets, the device's locale is set to en, but I'm using OneSkyOTAPlugin.setLanguage("pt-BR") to force to Portuguese. I'm seeing this for every key it tries to present:

OneSkyOTAPlugin - localized string not found for key: onboarding.sign-up-button, locale: pt-BR, falling back to locale without region: pt
OneSkyOTAPlugin - localized string not found for key: onboarding.sign-up-button, locale: pt-BR, falling back to development region language: en
OneSkyOTAPlugin - localized string not found for key: onboarding.sign-up-button, locale: pt-BR, falling back to mainBundle

Which makes sense on the first run of the app, because the translations haven't been downloaded yet. After a few seconds, I see in the logs that it has successfully downloaded all the translations, and both the pt-BR language and the key I need are in what's returned:

"pt-BR" =
...
"onboarding.sign-up-button" = "Cadastre-se";
...

If I close and re-run the app, I still get the same fallback messages, and english text throughout the app. I can also see in the logs that the plugin says translations are "up to date". Any ideas what's going on? I'm using 0.9.11.

I have this in didFinishLaunchingWithOptions:

OneSkyOTAPlugin.provideAPIKey("<key>", APISecret: nil, projectID: "<id>")
OneSkyOTAPlugin.setLanguage("pt-BR")

And this in applicationDidBecomeActive:

OneSkyOTAPlugin.checkForUpdate()

And this in my localized string wrapper:

OneSkyOTAPlugin.localizedStringForKey(key, value: key, table: nil)

Thanks!

stephenkopylov commented 8 years ago

Same problem! Sometimes, after using app, for example, for 4 days, this thing happens =( . screen shot 2016-06-06 at 17 23 08 screen shot 2016-06-06 at 17 23 14 screen shot 2016-06-06 at 17 23 37

upd: also, I get this error before all: screen shot 2016-06-06 at 17 28 46

bretdabaker commented 8 years ago

We are investigating the problem, will keep you updated.

bretdabaker commented 8 years ago

@pwightman we have found the problem, your project uses .csv instead of .strings files, when the plugin downloads the translations, it expects Localizable.strings but got Localizable instead. So it's not able to lookup the translations.

May I know why you use .csv instead of the standard .strings files? Are you experiencing some difficulties with .strings files on our platform? Most of our plugins support .strings files only, including the auto-screenshot-sdk, so we suggest you use .strings files for maximum capability.

As a quick fix, you can try editing the filenames and add .strings extension under Project > Files page.

bretdabaker commented 8 years ago

@stephenkopylov our server was down previously, so I think the problem is not related.

Anyway, we are working on some stability updates, will keep you posted.

pwightman commented 8 years ago

@bretdabaker Ah, that makes sense. We're using .csv because we were previously managing translations through google sheets and generated our .strings files using JS scripts, so our "source of truth" was never in a .strings file. I didn't realize you guys maintained the imported file format on your end, that's interesting. Can we "fix" this on our end in the meantime by re-importing our Files as .strings, then?

bretdabaker commented 8 years ago

@pwightman Yes the OTA should work once you upload the .strings to project, please make sure the content is the same as those in the .csv file.

pwightman commented 8 years ago

In looking into this, I'm not sure it's feasible to delete and re-upload, because we have a lot of metadata (screenshots, comments, etc) attached to our current files that can't be lost. Is it planned for the plugin to handle other upload types in the future, via asking the server explicitly for .strings versions or similar, regardless of upload format?

bretdabaker commented 8 years ago

@pwightman both screenshots and comments will be kept as long as the key/value pairs are exactly the same in the files. You don't need to delete the original .csv files until you have all .strings for each language uploaded. You can experiment with a new project.

Please download the update 0.9.12 for other bug fixes and improvements.