Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating .stringsdict localization files over-the-air

Tags:

I'm looking for a way to update stringsdict localization files over-the-air without having to release a new version in the appStore. So ideally I want my stringdict files on a webserver, and the iOS app should download these files from the website and update the local strings.

After doing some research, I realized that we cannot update files in the bundle it was shipped in however I found some reports saying we could store/load localizations in/from the application support folder.

source #1

source #2

source #3

Can this also be applied to stringsdict files because I'm trying but no success so far.

like image 964
Steven B. Avatar asked Mar 30 '17 10:03

Steven B.


People also ask

How to use Localized string in SwiftUI?

Use it in custom SwiftUI views to make them ready for localization. Enable the "Use Compiler to Extract Swift Strings" build setting to extract LocalizedStringKeys from code when exporting for localization in Xcode. Format your strings to internationalize your code, and style them with Markdown.

How add localize in Xcode?

Adding New LocalizationOpen Info tab, and click “+” button under Localizations section. Then choose a language you want to support from the dropdown list shown. XCode opens a dialog showing resources to be added for the new language.

How do I create a localizable string in Xcode?

Add localization files to your Xcode project This file works with key value pairs, with each key representing a string, one file per language. That's these keys that will then replace strings in your code. To create this file, go to File > New > File , search for Strings File andname it Localizable. strings .


1 Answers

Basically you need to create a .bundle with your new strings and make your app download it. After that, I think it's possible to create a NSBundle object using your freshly downloaded translations and swizzle a couple of methods from the main NSBundle currently used by the system.

I've tried something similar, but found out that it's much easier to integrate an existing service such as Smartling or Lokalise. They already have an SDK that allows you to update your translation over the air.

Also I found it's much easier to manage all my translations there.

like image 53
Arthur Avatar answered Sep 24 '22 10:09

Arthur