κ΅¬κΈ μ€νλ λ μνΈμ μμ±ν λ΄μ©μ μλλ‘μ΄λ μ€νλμ€μμ μ¬μ© κ°λ₯ν λ¬Έμμ΄ λ¦¬μμ€ νμΌ(.xml)λ‘ λ³ννλ€.
κ΅¬κΈ μνΈλ₯Ό μμ€ νμΌ(.xlsx)λ‘ λ€μ΄λ‘λ νλ€.
κ΅¬κΈ api κ΄λ ¨ ν¨ν€μ§
λ€μ΄λ‘λ ν μμ νμΌμ μ΄μ©νμ¬ λ¬Έμμ΄ λ¦¬μμ€ νμΌμ μμ±νλ€.
νλ¬κ·ΈμΈ κ΄λ ¨ ν¨ν€μ§
buildscript {
repositories {
maven("https://jitpack.io")
}
dependencies {
classpath(libs.rsupportrnd.android.string.table)
}
}
[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" }
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")
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
buildscript {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.github.rsupportrnd:android-string-table:1.0.6.15'
}
}
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"
}
Guide to get google credential
-
updateResource
μ€νλ λ μνΈλ₯Ό λ€μ΄λ‘λνκ³ λ¬Έμμ΄ λ¦¬μμ€ νμΌ(.xml)μ μμ±νλ€.
-
downloadSpreadsheet
μ€νλ λ μνΈλ₯Ό λ€μ΄λ‘λ νλ€.
-
generateStringsXmls
λ¬Έμμ΄ λ¦¬μμ€ νμΌ(.xml)μ μμ±νλ€.
β°μμ μ€νλ λ μνΈ : https://docs.google.com/spreadsheets/d/1W6WG_b40FmvyVbstodPgwA6USc0PRANoemCMN66_peM/edit#gid=0
- μΈλ±μ€ νμ νμνκΈ° μν΄ "id" νΉμ "identification"μ ν¬ν¨ν λ¬Έμμ΄μ μ λ ₯νλ€.
- μΈλ±μ€ νμ μ λ΄λΆ λ¬Έμμ΄μ "values"λ₯Ό ν¬ν¨νμ§ μκ±°λ μΈμ΄μ½λκ° μλ μ΄μ νμ±λμ§ μκ³ λμ΄κ°λ€.
- μλλ‘μ΄λ μ€νλμ€μμ κ΅κ°μ μΈμ΄ λ³λ‘ string.xml νμΌμ΄ λ΄κΈ΄ values ν΄λλ₯Ό λͺ λͺ νλ λ²μΉκ³Ό λμΌνκ² "values-κ΅κ°, μΈμ΄ μ½λ"λ‘ ν΄λΉ μ΄μ κ΅κ°μ μΈμ΄λ₯Ό νκΈ°νλ€.
- κ΅κ°μ μΈμ΄ μ½λκ° νκΈ°λμ§ μμ λ¨μ "values" μ΄μ κΈ°λ³Έ λ¬Έμμ΄ νμΌλ‘ λ³νλλ€. (default μ½λλ₯Ό μ§μ νλ©΄ values λ‘ μΉνλλ€.)
곡μ κΈ°λ₯μΌλ‘ λ§ν¬ 볡μ¬λ₯Ό νλ κ²μ΄ μλκ³ μ£Όμμ°½μ μλ μ£Όμλ₯Ό μ§μ 볡μ¬ν΄μ λΆμ¬λ£λλ€.
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.