Gradle tools for nstack
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
translation-plugin
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

nStack Badge

nstack-gradle

Gradle plugin for nstack.io to generate various project files such as:

  • Translation.java (Model class for using translations)
  • nstack_keys.xml (Strings resouces containing a list of all NStack keys to be used with the NStack Kotlin plugin)
  • all_translations.json (Asset file containing all our translations

Setup

Add this to your Project build.gradle:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        ...
        classpath 'dk.nodes.nstack:translation:0.31'
    }
}

Add this to your Module build.gradle:

apply plugin: 'dk.nstack.translation.plugin'

translation {
    appId = "<generated app id from nstack.io>"
    apiKey = "<generated app key from nstack.io>"
    acceptHeader = "da-dk" // Accept header for which langauge we are selecting
    autoRunUpdate = true // Should the gradle task auto update the translation assets/keys
}

Run

Find the generateTranslationClass gradle task and run it. Located in :/nstack.