diff --git a/SampleFiles/Colors/Generated/UIColor+GenAllScript.swift b/SampleFiles/Colors/Generated/UIColor+GenAllScript.swift new file mode 100644 index 0000000..43de86c --- /dev/null +++ b/SampleFiles/Colors/Generated/UIColor+GenAllScript.swift @@ -0,0 +1,21 @@ +// Generated from ColorToolCore at 2022-07-22 15:38:00 +0000 + +import UIKit + +extension UIColor { + + /// Color red is #FF0000 (light) or #FF0000 (dark)" + static var red: UIColor { + UIColor(named: "red")! + } + + /// Color green_alpha_50 is #A000FF00 (light) or #A000FF00 (dark)" + static var green_alpha_50: UIColor { + UIColor(named: "green_alpha_50")! + } + + /// Color blue_light_dark is #0000FF (light) or #0000AA (dark)" + static var blue_light_dark: UIColor { + UIColor(named: "blue_light_dark")! + } +} \ No newline at end of file diff --git a/SampleFiles/Fonts/Generated/UIFont+GenAllScript.swift b/SampleFiles/Fonts/Generated/UIFont+GenAllScript.swift new file mode 100644 index 0000000..398823b --- /dev/null +++ b/SampleFiles/Fonts/Generated/UIFont+GenAllScript.swift @@ -0,0 +1,62 @@ +// Generated from FontToolCore + +import UIKit + +extension UIFont { + + enum FontName: String { + case LatoItalic = "Lato-Italic" + case LatoLightItalic = "Lato-LightItalic" + case LatoHairline = "Lato-Hairline" + case LatoBold = "Lato-Bold" + case LatoBlack = "Lato-Black" + case LatoRegular = "Lato-Regular" + case LatoBlackItalic = "Lato-BlackItalic" + case LatoBoldItalic = "Lato-BoldItalic" + case LatoLight = "Lato-Light" + case LatoHairlineItalic = "Lato-HairlineItalic" + } + + // MARK: - Getter + + static let LatoItalic: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoItalic.rawValue, size: size)! + } + + static let LatoLightItalic: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoLightItalic.rawValue, size: size)! + } + + static let LatoHairline: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoHairline.rawValue, size: size)! + } + + static let LatoBold: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoBold.rawValue, size: size)! + } + + static let LatoBlack: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoBlack.rawValue, size: size)! + } + + static let LatoRegular: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoRegular.rawValue, size: size)! + } + + static let LatoBlackItalic: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoBlackItalic.rawValue, size: size)! + } + + static let LatoBoldItalic: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoBoldItalic.rawValue, size: size)! + } + + static let LatoLight: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoLight.rawValue, size: size)! + } + + static let LatoHairlineItalic: ((_ size: CGFloat) -> UIFont) = { size in + UIFont(name: FontName.LatoHairlineItalic.rawValue, size: size)! + } + +} \ No newline at end of file diff --git a/SampleFiles/Images/Generated/UIImage+GenAllScript.swift b/SampleFiles/Images/Generated/UIImage+GenAllScript.swift new file mode 100644 index 0000000..56f64d3 --- /dev/null +++ b/SampleFiles/Images/Generated/UIImage+GenAllScript.swift @@ -0,0 +1,32 @@ +// Generated from Imagium at 2022-07-22 15:38:05 +0000 +// Images from sampleImages + +import UIKit + +extension UIImage { + + static var article_notification_pull_detail: UIImage { + UIImage(named: "article_notification_pull_detail")! + } + + static var article_notification_pull: UIImage { + UIImage(named: "article_notification_pull")! + } + + static var new_article: UIImage { + UIImage(named: "new_article")! + } + + static var welcome_background: UIImage { + UIImage(named: "welcome_background")! + } + + static var article_trash: UIImage { + UIImage(named: "article_trash")! + } + + static var ic_close_article: UIImage { + UIImage(named: "ic_close_article")! + } + +} \ No newline at end of file diff --git a/SampleFiles/Strings/Generated/MyString+StringTargetSuffix.swift b/SampleFiles/Strings/Generated/MyString+TargetSuffix.swift similarity index 100% rename from SampleFiles/Strings/Generated/MyString+StringTargetSuffix.swift rename to SampleFiles/Strings/Generated/MyString+TargetSuffix.swift diff --git a/SampleFiles/Strings/Generated/String+GenAllScript.swift b/SampleFiles/Strings/Generated/String+GenAllScript.swift new file mode 100644 index 0000000..2538963 --- /dev/null +++ b/SampleFiles/Strings/Generated/String+GenAllScript.swift @@ -0,0 +1,65 @@ +// Generated from Strings-Stringium at 2022-07-22 15:38:03 +0000 + +import UIKit + +fileprivate let kStringsFileName = "sampleStrings" + +extension String { + + // MARK: - Webservice + + /// Translation in en : + /// en + static var param_lang: String { + NSLocalizedString("param_lang", tableName: kStringsFileName, bundle: Bundle.main, value: "en", comment: "") + } + + // MARK: - Generic + + /// Translation in en : + /// Back + static var generic_back: String { + NSLocalizedString("generic_back", tableName: kStringsFileName, bundle: Bundle.main, value: "Back", comment: "") + } + + /// Translation in en : + /// Loading data... + static var generic_loading_data: String { + NSLocalizedString("generic_loading_data", tableName: kStringsFileName, bundle: Bundle.main, value: "Loading data...", comment: "") + } + + /// Translation in en : + /// Welcome \"%@\" ! + static var generic_welcome_firstname_format: String { + NSLocalizedString("generic_welcome_firstname_format", tableName: kStringsFileName, bundle: Bundle.main, value: "Welcome \"%@\" !", comment: "") + } + + /// Translation in en : + /// Welcome \"%@\" ! + static func generic_welcome_firstname_format(arg0: String) -> String { + String(format: Self.generic_welcome_firstname_format, arg0) + } + + // MARK: - EqualSymbol + + /// Translation in en : + /// 1€ = 1 point ! + static var test_equal_symbol: String { + NSLocalizedString("test_equal_symbol", tableName: kStringsFileName, bundle: Bundle.main, value: "1€ = 1 point !", comment: "") + } + + // MARK: - Placeholders + + /// Translation in en : + /// You %%: %2$@ %1$@ Age: %3$d + static var placeholders_test_one: String { + NSLocalizedString("placeholders_test_one", tableName: kStringsFileName, bundle: Bundle.main, value: "You %%: %2$@ %1$@ Age: %3$d", comment: "") + } + + /// Translation in en : + /// You %%: %2$@ %1$@ Age: %3$d + static func placeholders_test_one(arg0: String, arg1: String, arg2: Int) -> String { + String(format: Self.placeholders_test_one, arg0, arg1, arg2) + } + +} \ No newline at end of file diff --git a/SampleFiles/Strings/Generated/String+StringPlaceholders.swift b/SampleFiles/Strings/Generated/String+Placeholders.swift similarity index 100% rename from SampleFiles/Strings/Generated/String+StringPlaceholders.swift rename to SampleFiles/Strings/Generated/String+Placeholders.swift diff --git a/SampleFiles/Strings/Generated/String+StringGenAllScript.swift b/SampleFiles/Strings/Generated/String+StringGenAllScript.swift deleted file mode 100644 index 69b5753..0000000 --- a/SampleFiles/Strings/Generated/String+StringGenAllScript.swift +++ /dev/null @@ -1,37 +0,0 @@ -// Generated from Strings-Stringium at 2022-02-14 09:30:20 +0000 - -import UIKit - -fileprivate let kStringsFileName = "sampleStrings" - -extension String { - - // MARK: - Webservice - - /// Translation in en : - /// en - static var param_lang: String { - NSLocalizedString("param_lang", tableName: kStringsFileName, bundle: Bundle.main, value: "en", comment: "") - } - - // MARK: - Generic - - /// Translation in en : - /// Back - static var generic_back: String { - NSLocalizedString("generic_back", tableName: kStringsFileName, bundle: Bundle.main, value: "Back", comment: "") - } - - /// Translation in en : - /// Loading data... - static var generic_loading_data: String { - NSLocalizedString("generic_loading_data", tableName: kStringsFileName, bundle: Bundle.main, value: "Loading data...", comment: "") - } - - /// Translation in en : - /// Welcome \"%@\" ! - static var generic_welcome_firstname_format: String { - NSLocalizedString("generic_welcome_firstname_format", tableName: kStringsFileName, bundle: Bundle.main, value: "Welcome \"%@\" !", comment: "") - } - -} \ No newline at end of file diff --git a/SampleFiles/Strings/Generated/String+StringTargetSuffix.swift b/SampleFiles/Strings/Generated/String+TargetSuffix.swift similarity index 100% rename from SampleFiles/Strings/Generated/String+StringTargetSuffix.swift rename to SampleFiles/Strings/Generated/String+TargetSuffix.swift diff --git a/SampleFiles/Strings/Generated/StringTest+StringPlaceholders.swift b/SampleFiles/Strings/Generated/StringTest+Placeholders.swift similarity index 100% rename from SampleFiles/Strings/Generated/StringTest+StringPlaceholders.swift rename to SampleFiles/Strings/Generated/StringTest+Placeholders.swift diff --git a/SampleFiles/Strings/Generated/en-us.lproj/sampleStrings.strings b/SampleFiles/Strings/Generated/en-us.lproj/sampleStrings.strings index 809b631..be59eba 100644 --- a/SampleFiles/Strings/Generated/en-us.lproj/sampleStrings.strings +++ b/SampleFiles/Strings/Generated/en-us.lproj/sampleStrings.strings @@ -18,6 +18,11 @@ "generic_welcome_firstname_format" = "Welcome \"%@\" !"; +/********** EqualSymbol **********/ + +"test_equal_symbol" = "1€ = 1 point !"; + + /********** Placeholders **********/ "placeholders_test_one" = "You %%: %2$@ %1$@ Age: %3$d"; diff --git a/SampleFiles/Strings/Generated/en.lproj/sampleStrings.strings b/SampleFiles/Strings/Generated/en.lproj/sampleStrings.strings index 6c41173..a0e6800 100644 --- a/SampleFiles/Strings/Generated/en.lproj/sampleStrings.strings +++ b/SampleFiles/Strings/Generated/en.lproj/sampleStrings.strings @@ -18,6 +18,11 @@ "generic_welcome_firstname_format" = "Welcome \"%@\" !"; +/********** EqualSymbol **********/ + +"test_equal_symbol" = "1€ = 1 point !"; + + /********** Placeholders **********/ "placeholders_test_one" = "You %%: %2$@ %1$@ Age: %3$d"; diff --git a/SampleFiles/Strings/Generated/fr.lproj/sampleStrings.strings b/SampleFiles/Strings/Generated/fr.lproj/sampleStrings.strings index 3e8399f..06df8fb 100644 --- a/SampleFiles/Strings/Generated/fr.lproj/sampleStrings.strings +++ b/SampleFiles/Strings/Generated/fr.lproj/sampleStrings.strings @@ -18,6 +18,11 @@ "generic_welcome_firstname_format" = "Bienvenue \"%@\" !"; +/********** EqualSymbol **********/ + +"test_equal_symbol" = "1€ = 1 point !"; + + /********** Placeholders **********/ "placeholders_test_one" = "Vous %%: %1$@ %2$@ Age: %3$d"; diff --git a/SampleFiles/Strings/sampleStrings.txt b/SampleFiles/Strings/sampleStrings.txt index 820b663..f6a94d5 100644 --- a/SampleFiles/Strings/sampleStrings.txt +++ b/SampleFiles/Strings/sampleStrings.txt @@ -25,7 +25,15 @@ comments = fr = Bienvenue "%@" ! en-us = Welcome "%@" ! - + +[[EqualSymbol]] + [test_equal_symbol] + en = 1€ = 1 point ! + tags = droid,ios + comments = + fr = 1€ = 1 point ! + en-us = 1€ = 1 point ! + [[Placeholders]] [placeholders_test_one] en = You %%: %2$@ %1$@ Age: %3$d diff --git a/SampleFiles/Tags/Generated/Tags+GenAllScript.swift b/SampleFiles/Tags/Generated/Tags+GenAllScript.swift new file mode 100644 index 0000000..3a617c5 --- /dev/null +++ b/SampleFiles/Tags/Generated/Tags+GenAllScript.swift @@ -0,0 +1,23 @@ +// Generated from Strings-Tags at 2022-07-22 15:38:04 +0000 + +// typelias Tags = String + +import UIKit + +extension Tags { + + // MARK: - ScreenTag + + /// Translation in ium : + /// Ecran un + static var screen_one: String { + "Ecran un" + } + + /// Translation in ium : + /// Ecran deux + static var screen_two: String { + "Ecran deux" + } + +} \ No newline at end of file diff --git a/Sources/Strings/Parser/TwineFileParser.swift b/Sources/Strings/Parser/TwineFileParser.swift index 0c56b66..55b4f08 100644 --- a/Sources/Strings/Parser/TwineFileParser.swift +++ b/Sources/Strings/Parser/TwineFileParser.swift @@ -40,13 +40,8 @@ class TwineFileParser { return } - let rightElement: String = { - if let last = splitLine.last, splitLine.count == 2 { - return String(last) - } - return "" - }() - + let rightElement: String = splitLine.dropFirst().joined(separator: "=") + // "fr " => "fr" let leftHand = String(leftElement).removeTrailingWhitespace() // " Test" => "Test"