Skip to content

Commit

Permalink
Release 2.0.127
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-roemer committed Aug 9, 2019
1 parent 22e2b43 commit 6c080de
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 17 deletions.
Binary file modified Applanga.framework/Applanga
Binary file not shown.
Binary file modified Applanga.framework/Info.plist
Binary file not shown.
2 changes: 1 addition & 1 deletion Applanga.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"2.0.126": "https://github.com/applanga/sdk-ios/releases/download/2.0.126/Applanga.framework.zip",
"2.0.127": "https://github.com/applanga/sdk-ios/releases/download/2.0.127/Applanga.framework.zip",
"2.0.122": "https://github.com/applanga/sdk-ios/releases/download/2.0.122/Applanga.framework.zip",
"2.0.120": "https://github.com/applanga/sdk-ios/releases/download/2.0.120/Applanga.framework.zip",
"2.0.121": "https://github.com/applanga/sdk-ios/releases/download/2.0.121/Applanga.framework.zip",
Expand All @@ -14,7 +15,6 @@
"2.0.103": "https://github.com/applanga/sdk-ios/releases/download/2.0.103/Applanga.framework.zip",
"2.0.88": "https://github.com/applanga/sdk-ios/releases/download/2.0.88/Applanga.framework.zip",
"2.0.89": "https://github.com/applanga/sdk-ios/releases/download/2.0.89/Applanga.framework.zip",
"2.0.83": "https://github.com/applanga/sdk-ios/releases/download/2.0.83/Applanga.framework.zip",
"2.0.85": "https://github.com/applanga/sdk-ios/releases/download/2.0.85/Applanga.framework.zip",
"2.0.86": "https://github.com/applanga/sdk-ios/releases/download/2.0.86/Applanga.framework.zip",
"2.0.87": "https://github.com/applanga/sdk-ios/releases/download/2.0.87/Applanga.framework.zip",
Expand Down
4 changes: 2 additions & 2 deletions Applanga.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Applanga"
s.version = "2.0.126"
s.version = "2.0.127"
s.summary = "This is the iOS SDK for Applanga."
s.homepage = "http://applanga.com"
s.license = { :type => 'Commercial', :file => 'LICENSE' }
s.author = { "Mbaas Development GmbH" => "developer@applanga.com" }
s.source = { :git => "https://github.com/applanga/sdk-ios.git", :tag => "2.0.126" }
s.source = { :git => "https://github.com/applanga/sdk-ios.git", :tag => "2.0.127" }
s.platform = :ios, '9.0'
s.frameworks = 'SystemConfiguration'
s.library = 'sqlite3', 'z'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
*Applanga iOS Documentation:* <https://www.applanga.com/docs-integration/ios>
***

### Version 2.0.127 (9 Aug 2019)
#### Added
- added ApplangaInitialUpdate setting
- added support for async javascript localization calls in WKWebViews

---
### Version 2.0.126 (18 Jul 2019)
#### Fixed
- added support for sr and sr-Latn
Expand Down
98 changes: 84 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Applanga SDK for iOS Localization
***
*Version:* 2.0.126
*Version:* 2.0.127

*Website:* <https://www.applanga.com>

Expand Down Expand Up @@ -269,7 +269,9 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you

Add `ApplangaTranslateWebViews` set to `YES` to your Info.plist to enable translation support for all WebViews.

To initalize Applanga for your webcontent you need to initialize Applanga from JavaScript:
There are some differences if you use the deprecated `UIWebView` or the newer `WKWebView` whereas direct Applanga calls in `UIWebView` ar synchronous but in `WKWebView` the need to be async.

To initalize Applanga for your webcontent in a `UIWebView` you need to initialize Applanga from JavaScript like this:

```javascript
<script type="text/javascript">
Expand All @@ -279,6 +281,8 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
}; window.initApplanga();
</script>
```

This is not needed if you use a `WKWebView`.

4.1 **Strings**
Expand All @@ -290,7 +294,16 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
</div>
```

Alternatively you can call `Applanga.getString('APPLANGA_ID')` directly.
Alternatively you can call `Applanga.getString` directly like this:

```javascript
//UIWebView
translation = Applanga.getString('APPLANGA_ID')
//WKWebView
Applanga.getString('APPLANGA_ID', undefined, undefined, undefined, undefined, undefined,
function(translation) {
})
```

4.2 **Arguments**

Expand All @@ -303,10 +316,15 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
***and formatted with arguments***
</div>
```
Direct call :
Direct call:

```javascript
Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc')
//UIWebView
translation = Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc')
//WKWebView
Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc', undefined, undefined, undefined, undefined,
function(translation) {
})
```

To define a different separator instead of ```,``` e.g. if your arguments contain commas use ```applanga-args-separator```.
Expand All @@ -320,10 +338,15 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
</div>
```

Direct call :
Direct call:

```javascript
Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc', ';')
//UIWebView
translation = Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc', ';')
//WKWebView
Applanga.getString('APPLANGA_ID', 'arg1,arg2,etc', ';', undefined, undefined, undefined,
function(translation) {
})
```
One Dimensional **JSON** Objects can also be used as ***Named Arguments*** if you add `applanga-args-separator="json"`
Expand All @@ -336,10 +359,15 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
***and formatted with json arguments***
</div>
```
Direct call :
Direct call:
```javascript
Applanga.getString('APPLANGA_ID', "{'arg1':'value1', 'arg2':'value2', 'arg3':'etc'}", 'json')
//UIWebView
translation = Applanga.getString('APPLANGA_ID', "{'arg1':'value1', 'arg2':'value2', 'arg3':'etc'}", 'json')
//WKWebView
Applanga.getString('APPLANGA_ID', "{'arg1':'value1', 'arg2':'value2', 'arg3':'etc'}", 'json', undefined, undefined, undefined,
function(translation) {
})
```

4.3 **Pluralisation**
Expand All @@ -352,16 +380,26 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
</div>
```

Direct call :
Direct call:

```javascript
Applanga.getPluralString('APPLANGA_ID', 'one')
//UIWebView
translation = Applanga.getPluralString('APPLANGA_ID', 'one')
//WKWebView
Applanga.getPluralString('APPLANGA_ID', 'one', undefined, undefined,
function(translation) {
})
```

or with arguments :
or with arguments:

```javascript
Applanga.getPluralString('APPLANGA_ID', 'one', 'arg1;arg2;etc', ';')
//UIWebView
translation = Applanga.getPluralString('APPLANGA_ID', 'one', 'arg1;arg2;etc', ';')
//WKWebView
Applanga.getPluralString('APPLANGA_ID', 'one', 'arg1;arg2;etc', ';',
function(translation) {
})
```
You can also pluralize by quantity via `applanga-plural-quantity`
Expand All @@ -372,8 +410,28 @@ Besides the Basic usage Applanga offers support for ***named arguments*** in you
</div>
```

Direct call : `Applanga.getQuantityString('APPLANGA_ID', 42)` or with arguments : `applanga.getQuantityString('APPLANGA_ID', 42, 'arg1;arg2;etc', ';')`
Direct call:

```javascript
//UIWebView
translation = Applanga.getQuantityString('APPLANGA_ID', 42)
//WKWebView
Applanga.getQuantityString('APPLANGA_ID', 42, undefined, undefined,
function(translation) {
})
```

or with arguments:

```javascript
//UIWebView
translation = Applanga.getQuantityString('APPLANGA_ID', 42, 'arg1;arg2;etc', ';')
//WKWebView
Applanga.getQuantityString('APPLANGA_ID', 42, 'arg1;arg2;etc', ';',
function(translation) {
})
```

4.4 **Update Content**

To trigger a content update from a WebView use javascript:
Expand Down Expand Up @@ -565,6 +623,18 @@ You can specify a set of default groups and languages in your plist, which will
bash update-settingsfile.sh ${YOUR TARGET DIRECTORY PATH}
```

5. **Disable automatic string update on init**

If you wish to stop the sdk from automatically updating your strings on app launch you can set the following

```xml
...
<key>ApplangaInitialUpdate</key>
<false/>
...
```
You will still be able to call Applanga.Update() at any time to update your strings

## Automatic Push Notification Localization and InfoPlist.strings

With the Applanga SDK you can only localize local notifications because remote notifications, the app display name (CFBundleDisplayName) as well as the several other NS*UsageDescription etc strings defined in your Info.plist are not using the app runtime and therefore can not be localized at runtime with a SDK. For these kind of strings you can use the [Applanga Command Line Interface](https://www.applanga.com/docs-integration/cli) to manage the strings on the [Applanga Dashboard](https://dashboard.applanga.com) and update the InfoPlist.strings files whenever you create a new build.
Expand Down

0 comments on commit 6c080de

Please sign in to comment.