From 142d844a498fcfc9f11f25b1e64f1abf324ba331 Mon Sep 17 00:00:00 2001 From: Christian Mayr Date: Fri, 9 Jun 2017 15:15:21 +0200 Subject: [PATCH 1/2] add done text property --- nativescript-imagepicker/index.d.ts | 2 ++ nativescript-imagepicker/viewmodel.ios.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nativescript-imagepicker/index.d.ts b/nativescript-imagepicker/index.d.ts index b949cfd..32078aa 100644 --- a/nativescript-imagepicker/index.d.ts +++ b/nativescript-imagepicker/index.d.ts @@ -80,6 +80,8 @@ interface Options { */ mode?: string; + doneText?: string; + android?: { /** * Provide a reason for permission request to access external storage on api levels above 23. diff --git a/nativescript-imagepicker/viewmodel.ios.ts b/nativescript-imagepicker/viewmodel.ios.ts index e13e46f..aeb66ce 100644 --- a/nativescript-imagepicker/viewmodel.ios.ts +++ b/nativescript-imagepicker/viewmodel.ios.ts @@ -70,7 +70,7 @@ export class ImagePicker extends data_observable.Observable { } get doneText(): string { - return "Done"; + return this._options && this._options.doneText ? this._options.doneText : "Done"; } get cancelText(): string { From 73990c5bcd9a753d91b38a6834c4993706269593 Mon Sep 17 00:00:00 2001 From: Christian Mayr Date: Fri, 9 Jun 2017 15:21:39 +0200 Subject: [PATCH 2/2] add configurable parameters for done, cancel and albums text --- nativescript-imagepicker/index.d.ts | 13 +++++++++++++ nativescript-imagepicker/viewmodel.ios.ts | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/nativescript-imagepicker/index.d.ts b/nativescript-imagepicker/index.d.ts index 32078aa..3170e98 100644 --- a/nativescript-imagepicker/index.d.ts +++ b/nativescript-imagepicker/index.d.ts @@ -80,8 +80,21 @@ interface Options { */ mode?: string; + /** + * Set the text for the done button in iOS + */ doneText?: string; + /** + * Set the text for the cancel button in iOS + */ + cancelText?: string; + + /** + * Set the text for the albums button in iOS + */ + albumsText?: string; + android?: { /** * Provide a reason for permission request to access external storage on api levels above 23. diff --git a/nativescript-imagepicker/viewmodel.ios.ts b/nativescript-imagepicker/viewmodel.ios.ts index aeb66ce..e25ba3e 100644 --- a/nativescript-imagepicker/viewmodel.ios.ts +++ b/nativescript-imagepicker/viewmodel.ios.ts @@ -74,11 +74,11 @@ export class ImagePicker extends data_observable.Observable { } get cancelText(): string { - return "Cancel"; + return this._options && this._options.cancelText ? this._options.cancelText : "Cancel"; } get albumsText(): string { - return "Albums"; + return this._options && this._options.albumsText ? this._options.albumsText : "Albums"; } get mode(): string {