8000 GitHub - rsupportrnd/android-string-table: android-string-table
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rsupportrnd/android-string-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

android-string-table

πŸ’‘ μ†Œκ°œ


ꡬ글 μŠ€ν”„λ ˆλ“œ μ‹œνŠΈμ— μž‘μ„±ν•œ λ‚΄μš©μ„ μ•ˆλ“œλ‘œμ΄λ“œ μŠ€νŠœλ””μ˜€μ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ λ¬Έμžμ—΄ λ¦¬μ†ŒμŠ€ 파일(.xml)둜 λ³€ν™˜ν•œλ‹€.

πŸ’‘ Package별 κΈ°λŠ₯ 상세


com.rsupport.download

ꡬ글 μ‹œνŠΈλ₯Ό μ—‘μ„€ 파일(.xlsx)둜 λ‹€μš΄λ‘œλ“œ ν•œλ‹€.

com.rsupport.google

ꡬ글 api κ΄€λ ¨ νŒ¨ν‚€μ§€

com.ruspport.stringtable

λ‹€μš΄λ‘œλ“œ ν•œ μ—‘μ…€ νŒŒμΌμ„ μ΄μš©ν•˜μ—¬ λ¬Έμžμ—΄ λ¦¬μ†ŒμŠ€ νŒŒμΌμ„ μƒμ„±ν•œλ‹€.

com.rsupport.plugin

ν”ŒλŸ¬κ·ΈμΈ κ΄€λ ¨ νŒ¨ν‚€μ§€

πŸ’‘ν”ŒλŸ¬κ·ΈμΈ 적용 방법


Kotlin DSL (Version catalog)

Build.gradle.kts(:project)

buildscript {
  repositories {
    maven("https://jitpack.io")
  }
  dependencies {
    classpath(libs.rsupportrnd.android.string.table)
  }
}

libs.versions.toml

[versions]
androidStringTable = "1.0.6.15"

[libraries]
rsupportrnd-android-string-table = { group = "com.github.rsupportrnd", name = "android-string-table", version.ref = "androidStringTable" }

[plugins]
android-string-table = { id = "android-string-table" }

Build.gradle.kts(:app)

plugins {
  alias(libs.plugins.android.string.table)
}

androidStringTable {
  googleDriveCredentialPath.value("${project.rootDir}/strings/credentials.json")
  targetSheetUrl.value("https://docs.google.com/spreadsheets/d/1W6WG_b40FmvyVbstodPgwA6USc0PRANoemCMN66_peM/edit#gid=0") // full url of sheet included tab gid
  outputXlsxFilePath.value("${project.rootDir}/strings/archive.xlsx")
  androidResourcePath.value("$projectDir/src/main/res")
  
  // μ•„λž˜λΆ€ν„° μƒλž΅ κ°€λŠ₯
  rowPositionColumnHeader.value(1)
  defaultLanguageForValues.value("en") // values 둜 지정됨
  doNotConvertNewLine.value(false)
  outputXmlFileName.value("strings_generated")
}

Setting.gradle.kts(:Project Settings)

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
    maven("https://jitpack.io")
  }
}

Groovy DSL

Build.gradle(:project)

buildscript {  
      repositories {  
            google()  
            jcenter()  
            maven { url 'https://jitpack.io' }  
        }  
        dependencies {
            classpath 'com.github.rsupportrnd:android-string-table:1.0.6.15'
      }  
    }

Build.gradle(:app)

apply plugin: 'android-string-table'
    
androidStringTable {  
    googleDriveCredentialPath "${project.rootDir}/strings/credentials.json"

    targetSheetUrl 'https://docs.google.com/spreadsheets/d/1W6WG_b40FmvyVbstodPgwA6USc0PRANoemCMN66_peM/edit#gid=0' // full url of sheet included tab gid
    outputXlsxFilePath "${project.rootDir}/strings/archive.xlsx"
    androidResourcePath "src/main/res"
  
    // μ•„λž˜λΆ€ν„° μƒλž΅ κ°€λŠ₯
    rowPositionColumnHeader 1
    defaultLanguageForValues "en" // values 둜 지정됨 
    doNotConvertNewLine false
    outputXmlFileName "strings_generated.xml"
}

πŸ’‘ Credential 파일 λ‹€μš΄λ‘œλ“œ 방법

Guide to get google credential

πŸ’‘ ν”ŒλŸ¬κ·ΈμΈ μ μš©μ‹œ μƒμ„±λ˜λŠ” task


screenshot10

  • updateResource

    μŠ€ν”„λ ˆλ“œ μ‹œνŠΈλ₯Ό λ‹€μš΄λ‘œλ“œν•˜κ³  λ¬Έμžμ—΄ λ¦¬μ†ŒμŠ€ 파일(.xml)을 μƒμ„±ν•œλ‹€.

  • downloadSpreadsheet

    μŠ€ν”„λ ˆλ“œ μ‹œνŠΈλ₯Ό λ‹€μš΄λ‘œλ“œ ν•œλ‹€.

  • generateStringsXmls

    λ¬Έμžμ—΄ λ¦¬μ†ŒμŠ€ 파일(.xml)을 μƒμ„±ν•œλ‹€.

πŸ’‘ ν”ŒλŸ¬κ·ΈμΈ 적용 κ°€λŠ₯ν•œ μŠ€ν”„λ ˆλ“œ μ‹œνŠΈ μž‘μ„± 방법


➰예제 μŠ€ν”„λ ˆλ“œ μ‹œνŠΈ : https://docs.google.com/spreadsheets/d/1W6WG_b40FmvyVbstodPgwA6USc0PRANoemCMN66_peM/edit#gid=0

screenshot11

  1. 인덱슀 행을 ν‘œμ‹œν•˜κΈ° μœ„ν•΄ "id" ν˜Ήμ€ "identification"을 ν¬ν•¨ν•œ λ¬Έμžμ—΄μ„ μž…λ ₯ν•œλ‹€.
  2. 인덱슀 ν–‰μ˜ μ…€ λ‚΄λΆ€ λ¬Έμžμ—΄μ— "values"λ₯Ό ν¬ν•¨ν•˜μ§€ μ•Šκ±°λ‚˜ μ–Έμ–΄μ½”λ“œκ°€ μ•„λ‹Œ 열은 νŒŒμ‹±λ˜μ§€ μ•Šκ³  λ„˜μ–΄κ°„λ‹€.
  3. μ•ˆλ“œλ‘œμ΄λ“œ μŠ€νŠœλ””μ˜€μ—μ„œ ꡭ가와 μ–Έμ–΄ λ³„λ‘œ string.xml 파일이 λ‹΄κΈ΄ values 폴더λ₯Ό λͺ…λͺ…ν•˜λŠ” 법칙과 λ™μΌν•˜κ²Œ "values-κ΅­κ°€, μ–Έμ–΄ μ½”λ“œ"둜 ν•΄λ‹Ή μ—΄μ˜ ꡭ가와 μ–Έμ–΄λ₯Ό ν‘œκΈ°ν•œλ‹€.
  4. ꡭ가와 μ–Έμ–΄ μ½”λ“œκ°€ ν‘œκΈ°λ˜μ§€ μ•Šμ€ λ‹¨μˆœ "values" 열은 κΈ°λ³Έ λ¬Έμžμ—΄ 파일둜 λ³€ν™˜λœλ‹€. (default μ½”λ“œλ₯Ό μ§€μ •ν•˜λ©΄ values 둜 μΉ˜ν™˜λœλ‹€.)

πŸ’‘ μŠ€ν”„λ ˆλ“œ μ‹œνŠΈ URL


곡유 κΈ°λŠ₯으둜 링크 볡사λ₯Ό ν•˜λŠ” 것이 μ•„λ‹ˆκ³  μ£Όμ†Œμ°½μ— μžˆλŠ” μ£Όμ†Œλ₯Ό 직접 λ³΅μ‚¬ν•΄μ„œ λΆ™μ—¬λ„£λŠ”λ‹€.

The MIT License (MIT)

Copyright Β© 2024 RSUPPORT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the β€œSoftware”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

android-string-table

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 9

0