Merge pull request #147 from TouchInstinct/feature/swift_module_phases
Fix strings import script
This commit is contained in:
commit
9747bc014a
|
|
@ -38,10 +38,10 @@
|
||||||
'// swiftlint:disable line_length'.PHP_EOL.
|
'// swiftlint:disable line_length'.PHP_EOL.
|
||||||
'// swiftlint:disable file_length'.PHP_EOL.
|
'// swiftlint:disable file_length'.PHP_EOL.
|
||||||
'// swiftlint:disable identifier_name'.PHP_EOL.PHP_EOL.
|
'// swiftlint:disable identifier_name'.PHP_EOL.PHP_EOL.
|
||||||
'extension String {'.PHP_EOL;
|
'public extension String {'.PHP_EOL;
|
||||||
foreach ($json as $key=>$value) {
|
foreach ($json as $key=>$value) {
|
||||||
$value_without_linefeed = preg_replace("/\r|\n/", " ", $value);
|
$value_without_linefeed = preg_replace("/\r|\n/", " ", $value);
|
||||||
$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 .= "\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 .= '}'.PHP_EOL;
|
$ios_swift_strings .= '}'.PHP_EOL;
|
||||||
file_put_contents($localization.'String+Localization.swift', $ios_swift_strings);
|
file_put_contents($localization.'String+Localization.swift', $ios_swift_strings);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue