From 1d04958271220d0c0708d6cb373a5752ddaba662 Mon Sep 17 00:00:00 2001 From: Victor Shabanov Date: Thu, 17 Oct 2019 15:42:36 +0300 Subject: [PATCH 1/2] Change api generation and localization scripts to work with swift modules --- xcode/aux_scripts/import_strings.php | 4 ++-- xcode/build_phases/api_generator.sh | 2 +- xcode/build_phases/localization.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xcode/aux_scripts/import_strings.php b/xcode/aux_scripts/import_strings.php index 911e989..814928a 100644 --- a/xcode/aux_scripts/import_strings.php +++ b/xcode/aux_scripts/import_strings.php @@ -1,5 +1,5 @@ Date: Thu, 17 Oct 2019 15:50:28 +0300 Subject: [PATCH 2/2] Fix localization NSLocalizedString static values visibility --- xcode/aux_scripts/import_strings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/aux_scripts/import_strings.php b/xcode/aux_scripts/import_strings.php index 814928a..3f13353 100644 --- a/xcode/aux_scripts/import_strings.php +++ b/xcode/aux_scripts/import_strings.php @@ -41,7 +41,7 @@ 'extension String {'.PHP_EOL; foreach ($json as $key=>$value) { $value_without_linefeed = preg_replace("/\r|\n/", " ", $value); - $ios_swift_strings .= "\t/// ".$value_without_linefeed."\n\t".'static let '.preg_replace_callback('/_(.?)/', function ($m) { return strtoupper($m[1]); }, $key).' = NSLocalizedString("'.$key.'", comment: "")'."\n".PHP_EOL; + $ios_swift_strings .= "\t/// ".$value_without_linefeed."\n\t".'public static let '.preg_replace_callback('/_(.?)/', function ($m) { return strtoupper($m[1]); }, $key).' = NSLocalizedString("'.$key.'", comment: "")'."\n".PHP_EOL; } $ios_swift_strings .= '}'.PHP_EOL; file_put_contents($localization.'String+Localization.swift', $ios_swift_strings);