Skip to content

Commit

Permalink
Fix api change
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-powell committed Jan 10, 2025
1 parent 41122b9 commit ca10c9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal fun Table<ResourceNamespace, ResourceType, ResourceValueMap>.pseudoloca
for (namespace in rowKeySet()) {
for (type in columnKeySet()) {
val resourceValues = this[namespace, type]!!
resourceValues.forEach { (key, value) ->
resourceValues.values().forEach { value ->
if (value !is BasicValueResourceItemBase || !value.isPseudolocalizable()) {
return@forEach
}
Expand All @@ -34,7 +34,7 @@ internal fun Table<ResourceNamespace, ResourceType, ResourceValueMap>.pseudoloca
}

val pseudoLocaleSourceFile = value.sourceFile.forLocale(localeQualifier)
resourceValues[key] = when (value.resourceType) {
resourceValues[value.name] = when (value.resourceType) {
ResourceType.STRING -> {
pseudolocalizeString(value as BasicValueResourceItem, pseudoLocaleSourceFile, method)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,16 @@ class PseudolocaleGeneratorTest {
ResourceNamespace.TODO(),
type,
ResourceValueMap.create().apply {
putAll(items.map { it.name to it as ResourceValue })
items.forEach { put(it.name, it as ResourceValue) }
}
)
}

return table
}

private val ResourceValueMap.size: Int
get() = values().size

private fun ResourceValueMap.getValue(name: String) = get(name)!!
}

0 comments on commit ca10c9d

Please sign in to comment.