xcstrings #10

Merged
q.bandera merged 11 commits from xcstrings into master 2024-04-19 16:59:04 +02:00
Showing only changes of commit 1d7fc76340 - Show all commits

View File

@ -85,13 +85,12 @@ class Definition {
} }
private func getBaseProperty(lang: String, translation: String, isStatic: Bool, comment: String?) -> String { private func getBaseProperty(lang: String, translation: String, isStatic: Bool, comment: String?) -> String {
""" """
/// Translation in \(lang) : /// Translation in \(lang) :

On va simplifier et éviter la duplcation de la property. Mets toujours le commentaire :

/// Translation in \(lang) :
/// \(translation)
///
/// Comment:
/// \(comment?.isEmpty ? comment : "No comment")

et dans la property tu peux toujours mettre , comment: "\(comment ?? "")"

On va simplifier et éviter la duplcation de la property. Mets toujours le commentaire : ``` /// Translation in \(lang) : /// \(translation) /// /// Comment: /// \(comment?.isEmpty ? comment : "No comment") ``` et dans la property tu peux toujours mettre `, comment: "\(comment ?? "")"`
/// \(translation) /// \(translation)
/// ///
/// Comment : /// Comment :
/// \((comment ?? "").isEmpty ? "No comment" : comment!) /// \(comment?.isEmpty == false ? comment! : "No comment")
\(isStatic ? "static ": "")var \(name): String { \(isStatic ? "static ": "")var \(name): String {
NSLocalizedString("\(name)", tableName: kStringsFileName, bundle: Bundle.main, value: "\(translation)", comment: "\(comment ?? "")") NSLocalizedString("\(name)", tableName: kStringsFileName, bundle: Bundle.main, value: "\(translation)", comment: "\(comment ?? "")")
} }
@ -107,7 +106,7 @@ class Definition {
/// \(translation) /// \(translation)
/// ///
/// Comment : /// Comment :
/// \((comment ?? "").isEmpty ? "No comment" : comment!) /// \(comment?.isEmpty == false ? comment! : "No comment")
\(isStatic ? "static ": "")func \(name)(\(inputParameters.joined(separator: ", "))) -> String { \(isStatic ? "static ": "")func \(name)(\(inputParameters.joined(separator: ", "))) -> String {
String(format: \(isStatic ? "Self" : "self").\(name), \(translationArguments.joined(separator: ", "))) String(format: \(isStatic ? "Self" : "self").\(name), \(translationArguments.joined(separator: ", ")))
} }
@ -186,7 +185,7 @@ class Definition {
/// \(translation) /// \(translation)
/// ///
/// Comment : /// Comment :
/// \((comment ?? "").isEmpty ? "No comment" : comment!) /// \(comment?.isEmpty == false ? comment! : "No comment")
var \(name): String { var \(name): String {
"\(translation)" "\(translation)"
@ -206,7 +205,7 @@ class Definition {
/// \(translation) /// \(translation)
/// ///
/// Comment : /// Comment :
/// \((comment ?? "").isEmpty ? "No comment" : comment!) /// \(comment?.isEmpty == false ? comment! : "No comment")
static var \(name): String { static var \(name): String {
"\(translation)" "\(translation)"
} }