GitXplorerGitXplorer
h

localization-gradle-plugin

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
70ab4f5867063157541cf05fa4e6477cd7bf7de8

Published under the new namespace `com.hanggrian`, use Java version 8 as target compilation

hhanggrian committed 5 months ago
Unverified
467d51ece2a35fbe54b7a1bed4fb197cfca63c07

Replace Travis CI with CircleCI, remove text builder DSL in task

hhanggrian committed 5 months ago
Unverified
70533bfd176a7c520e959b7b6a0e28d45da98414

Preparing for next publication

hhanggrian committed 2 years ago
Unverified
70293761b25830f902b727da52f9034f3e2c34f6

New Codecov Travis integration, KtLint configurator function and Prism code highlighter

hhanggrian committed 2 years ago
Unverified
94249082d42a060a1b412313fb01980b47449540

Remove old main module, add column limit to 80, add `Config` suffix to KTS functions used with double colon operator

hhanggrian committed 2 years ago
Unverified
662afc705c568071edc249bfb9ca08706a112952

Massive project layout changes:

hhanggrian committed 2 years ago

README

The README file for this repository.

CircleCI Plugin Portal Java

Localization Gradle Plugin

An write-once-run-anywhere approach to localization in multiple platform project.

  • Writes ResourceBundle for Java and XML values for Android.
  • Localization data can be placed within Gradle script or CSV file.

Download

Using plugins DSL:

plugins {
    id('com.hanggrian.localization') version "$version"
}

Using legacy plugin application:

buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath("com.hanggrian:localization-gradle-plugin:$version")
    }
}

apply plugin: 'com.hanggrian.localization'

Usage

Apply plugin in your module, and configure localization extension like below:

localization {
    resourceName.set('strings')
    text('home') {
        en = 'Home'
        id = 'Beranda'
    }
    text('about') {
        en = 'About'
        id = 'Tentang'
    }
}

tasks {
    localizeJvm {
        outputDirectory.set(new File('src/main/resources'))
    }
    localizeAndroid {
        outputDirectory.set(new File('my/custom/directory'))
    }
}

It's even simpler with Gradle Kotlin DSL.

localization {
    "home" {
        en = "Home"
        id = "Beranda"
    }
    "about" {
        en = "About"
        id = "Tentang"
    }
}

Then use command localizeJvm or localizeAndroid to write localization files into their respective directory.