| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // Temporary generated en files for enum Generation
- // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
- // Source: https://github.com/SwiftGen/SwiftGen/discussions/1071#discussioncomment-7209188
- {% if files %}
- {% macro fileBlock file %}
- {% call documentBlock file file.document %}
- {% endmacro %}
- {# process the file #}
- {% macro documentBlock file document %}
- {% if document.metadata.type == "Dictionary" %}
- {% for key,value in document.metadata.properties %}
- {% call propertyBlock key value document.data %}
- {% endfor %}
- {% endif %}
- {% endmacro %}
- {# process the root dictionary #}
- {% macro propertyBlock key metadata data %}
- {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %}
- {% if propertyName == "strings" %}
- {% for propertyKey in data[key] %}
- {% set propertyValue %}{{data[key][propertyKey].localizations.en.stringUnit.value}}{% endset %}
- {% set propertyPluralValue %}{{data[key][propertyKey].localizations.en.variations.plural.other.stringUnit.value}}{% endset %}
- {% if propertyValue %}
- "{{propertyKey}}" = "{{propertyValue}}";
- {% endif %}
- {% if propertyPluralValue %}
- "{{propertyKey}}" = "{{propertyPluralValue}}";
- {% endif %}
- {% endfor %}
- {% else %}
- {% endif %}
- {% endmacro %}
- {% if files.count > 1 or param.forceFileNameEnum %}
- {% for file in files %}
- {% filter indent:2," ",true %}{% call fileBlock file %}{% endfilter %}
- {% endfor %}
- {% else %}
- {% call fileBlock files.first %}
- {% endif %}
- {% else %}
- // No xcstring files found.
- {% endif %}
|