Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.

Overview

Gradle-i18n-plugin

Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.

The plugin assumes that you have a series of columns, each representing a locale, as well as a column for the translation key.
The plugin also assumes that the first row of the given column, contains the language code of the locale. See the below image for an example of this setup.

image

Considering the above example, a JSON file of the following structure would be generated:

{
  "da-DK": {
    "booking.cancel.bookingDoesNotExist": "Bookingen kan ikke findes.",
    "booking.cancel.button.cancelBooking": "Aflys booking",
    ...
  },
  "en-US": {
    "booking.cancel.bookingDoesNotExist": "The booking could not be found.",
    "booking.cancel.button.cancelBooking": "Cancel booking",
    ...
  }
}

NOTE: Blank cells will be filtered out, so make sure that you don't have only partially filled rows.

Setup

To integrate the plugin into your setup, simply add it as a plugin in your build.gradle file.

plugins {
    id "dk.acto.gradle.i18nplugin" version "1.0"
}

This will include the generateI18n task, as well as the i18n configuration block into your setup.

The plugin accepts the following parameters for configuration:

Key Value Required
driveCredentialsFile The JSON file containing your Google Cloud credentials Yes
outputFile The file to which the plugin should write the generated JSON Yes
spreadsheetId The ID of the Google Spreadsheet (can be found in the URL) Yes
sheetId The name of the sheet, on the given spreadsheet No, defaults to "Sheet1"
localeColumns A list of the columns to include as locales Yes
keyColumn The column containing the translation keys Yes

Example configuration:

i18n {
  driveCredentialsFile = layout.projectDirectory.file("driveCredentials.json")
  outputFile = layout.projectDirectory.file("languageCache.json")
  spreadsheetId = "abcdefgh"
  localeColumns = ["C", "D"]
  keyColumn = "E"
}

build.dependsOn(generateI18n)
You might also like...
Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application
Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

Graphfity creates a dependency nodes diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module app

A Gradle Plugin to determine which modules were affected by a set of files in a commit.
A Gradle Plugin to determine which modules were affected by a set of files in a commit.

A Gradle Plugin to determine which modules were affected by a set of files in a commit. One use case for this plugin is for developers who would like to only run tests in modules which have changed in a given commit.

EasyVersion is a Gradle plugin that manage your app or library version.

EasyVersion EasyVersion is a Gradle plugin that manage your app or library version. Before Downloading Create easy_version.json in your root project d

A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

Change Tracker Plugin A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes

Android Gradle Plugin -- Auto Check big image and compress image in building.

McImage I will continue to update, please rest assured to use 中文文档 Android优雅的打包时自动化获取全部res资源 McImage is a Non-invasive plugin for compress all res in

Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.

Multiplatform Swift Package This is a Gradle plugin for Kotlin Multiplatform projects that generates an XCFramework for your native Apple targets and

A Gradle plugin helps to proxy all the BuildConfig fields in the Android project.
A Gradle plugin helps to proxy all the BuildConfig fields in the Android project.

Readme A Gradle plugin helps to proxy all the BuildConfig fields in the Android project. Background In android BuildConfig, We might have different co

Gradle Plugin for publishing artifacts to Sonatype and Nexus

Introduction Due to Sonatype's strict validation rules, the publishing requirement must be satisfied by every artifact which wants to be published to

Gradle plugin that parses version updates and assigns them to groups of people.

Notifier Gradle Plugin This gradle plugin serves the need of automating how dependencies are handles in a project. More specifically, it functions usi

Owner
Acto ApS
Tommorow's solutions - today
Acto ApS
A Gradle plugin for generating multi-version packet wrappers for Minecraft: JE

tinyprotocol A Gradle plugin for generating multi-version packet class wrappers for Minecraft: Java Edition. Usage plugins { id("me.kcra.tinyproto

Matouš Kučera 2 Feb 21, 2022
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

null 2 Mar 8, 2022
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Dipien 142 Dec 29, 2022
Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it

decomposer Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it How to use Run bui

Takahiro Menju 56 Nov 18, 2022
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.

CompleteKotlin Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms. What this plugin provides This zero-conf

Louis CAD 235 Jan 3, 2023
A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

Rikka apps 124 Dec 31, 2022
Grazel is a Gradle plugin to automate generation of valid Bazel files for a given Android/Kotlin/Java project.

Grazel Grazel stands for Gradle to Bazel. It is a Gradle plugin that enables you to migrate Android projects to Bazel build system in an incremental a

Grab 228 Jan 2, 2023
Gradle Plugin for Continuous Integration of AppSweep App Testing.

This Gradle plugin can be used to continuously integrate app scanning using AppSweep into your Android app build process

Guardsquare 28 Nov 13, 2022
Gradle plugin which validates the licenses of your dependency graph match what you expect

Gradle plugin which validates the licenses of your dependency graph match what you expect

Cash App 502 Dec 31, 2022
Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders.

Artifactory Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders. Currently, Fabric and Forge ar

Zach Kozar 3 Dec 29, 2021