feat(RES-58): Add new parameter "bundle" (#19)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
Add bundle parameter to define if resource should be load from Bundle.main (app) or Bundle.module (SPM package) Reviewed-on: #19
This commit is contained in:
@@ -11,7 +11,7 @@ import ToolCore
|
||||
extension StringsFileGeneratorTests {
|
||||
|
||||
static func getExtensionContentExpectation(
|
||||
staticVar: Bool,
|
||||
isStatic: Bool,
|
||||
s1DefOneFr: String = "Section Un - Definition Un",
|
||||
s1DefOneComment: String = "",
|
||||
s1DefTwoFr: String = "Section Un - Definition Deux",
|
||||
@@ -20,7 +20,8 @@ extension StringsFileGeneratorTests {
|
||||
s2DefOneComment: String = "",
|
||||
s2DefTwoFr: String = "Section Deux - Definition Deux",
|
||||
s2DefTwoComment: String = "",
|
||||
visibility: ExtensionVisibility = .internal
|
||||
visibility: ExtensionVisibility = .internal,
|
||||
assetBundle: AssetBundle = .main
|
||||
) -> String {
|
||||
"""
|
||||
// Generated by ResgenSwift.Strings.Stringium \(ResgenSwiftVersion)
|
||||
@@ -54,8 +55,8 @@ extension StringsFileGeneratorTests {
|
||||
///
|
||||
/// Comment :
|
||||
/// \(s1DefOneComment.isEmpty ? "No comment" : s1DefOneComment)
|
||||
\(visibility) \(staticVar ? "static " : "")var s1_def_one: String {
|
||||
NSLocalizedString("s1_def_one", tableName: kStringsFileName, bundle: Bundle.main, value: "Section Un - Definition Un", comment: "\(s1DefOneComment)")
|
||||
\(visibility) \(isStatic ? "static " : "")var s1_def_one: String {
|
||||
NSLocalizedString("s1_def_one", tableName: kStringsFileName, bundle: Bundle.\(assetBundle), value: "Section Un - Definition Un", comment: "\(s1DefOneComment)")
|
||||
}
|
||||
|
||||
/// Translation in fr :
|
||||
@@ -63,8 +64,8 @@ extension StringsFileGeneratorTests {
|
||||
///
|
||||
/// Comment :
|
||||
/// \(s1DefTwoComment.isEmpty ? "No comment" : s1DefTwoComment)
|
||||
\(visibility) \(staticVar ? "static " : "")var s1_def_two: String {
|
||||
NSLocalizedString("s1_def_two", tableName: kStringsFileName, bundle: Bundle.main, value: "Section Un - Definition Deux", comment: "\(s1DefTwoComment)")
|
||||
\(visibility) \(isStatic ? "static " : "")var s1_def_two: String {
|
||||
NSLocalizedString("s1_def_two", tableName: kStringsFileName, bundle: Bundle.\(assetBundle), value: "Section Un - Definition Deux", comment: "\(s1DefTwoComment)")
|
||||
}
|
||||
|
||||
// MARK: - section_two
|
||||
@@ -74,8 +75,8 @@ extension StringsFileGeneratorTests {
|
||||
///
|
||||
/// Comment :
|
||||
/// \(s2DefOneComment.isEmpty ? "No comment" : s2DefOneComment)
|
||||
\(visibility) \(staticVar ? "static " : "")var s2_def_one: String {
|
||||
NSLocalizedString("s2_def_one", tableName: kStringsFileName, bundle: Bundle.main, value: "Section Deux - Definition Un", comment: "\(s2DefOneComment)")
|
||||
\(visibility) \(isStatic ? "static " : "")var s2_def_one: String {
|
||||
NSLocalizedString("s2_def_one", tableName: kStringsFileName, bundle: Bundle.\(assetBundle), value: "Section Deux - Definition Un", comment: "\(s2DefOneComment)")
|
||||
}
|
||||
|
||||
/// Translation in fr :
|
||||
@@ -83,8 +84,8 @@ extension StringsFileGeneratorTests {
|
||||
///
|
||||
/// Comment :
|
||||
/// \(s2DefTwoComment.isEmpty ? "No comment" : s2DefTwoComment)
|
||||
\(visibility) \(staticVar ? "static " : "")var s2_def_two: String {
|
||||
NSLocalizedString("s2_def_two", tableName: kStringsFileName, bundle: Bundle.main, value: "Section Deux - Definition Deux", comment: "\(s2DefTwoComment)")
|
||||
\(visibility) \(isStatic ? "static " : "")var s2_def_two: String {
|
||||
NSLocalizedString("s2_def_two", tableName: kStringsFileName, bundle: Bundle.\(assetBundle), value: "Section Deux - Definition Deux", comment: "\(s2DefTwoComment)")
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
Reference in New Issue
Block a user