Skip to content

Add support for multiple language directories#5

Draft
aurakle wants to merge 2 commits intoFallen-Breath:masterfrom
aurakle:master
Draft

Add support for multiple language directories#5
aurakle wants to merge 2 commits intoFallen-Breath:masterfrom
aurakle:master

Conversation

@aurakle
Copy link

@aurakle aurakle commented Mar 23, 2025

When working on Trickster, I ran into an interesting situation: I found myself wanting to convert YAML language files present both in the primary mod resources (assets/trickster) and the secondary (assets/whatever_else).

Due to yamlang lacking support for this, I've implemented an alternative way of defining input and output directories. If inputDir is defined, this alternative option is ignored. These changes add two new properties: directories, which is basically inputDir as a list; and directoriesMapped, which is inputDir -> outputDir as a list (the key is the inputDir, the value is the outputDir). These two other properties get merged to allow definitions such as this:

yamlang {
    targetSourceSets = [sourceSets.main]
    directoriesMapped = [
        'assets/example/yamlang': "assets/example/lang"
    ]
    directories = [
        "assets/example/lang"
    ]
}

The above results in a mapping which can be represented as:

[
    'assets/example/yamlang': "assets/example/lang",
    'assets/example/lang': "assets/example/lang"
]

(I also set the executable flag on gradlew, and renamed the *_PREFIX static fields to *_SUFFIX, as they go after and not before the filename.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant