-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…or-strings-generator #723 support android format for strings generator
- Loading branch information
Showing
9 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../test/kotlin/dev/icerock/gradle/generator/stringsGenerator/XmlStringsAndroidFormatTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.gradle.generator.stringsGenerator | ||
|
||
import dev.icerock.gradle.utils.convertXmlStringToAndroidLocalization | ||
import dev.icerock.gradle.utils.removeAndroidMirroringFormat | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class XmlStringsAndroidFormatTest { | ||
@Test | ||
fun quotesAndroidFormat() { | ||
assertEquals( | ||
expected = """Same text with symbol's @ ? somet'ing "word"""", | ||
actual = TEXT_WITH_QUOTES.removeAndroidMirroringFormat() | ||
) | ||
} | ||
|
||
@Test | ||
fun quotesAndroidInOutFormat() { | ||
assertEquals( | ||
expected = """Same text with symbol\'s @ ? somet\'ing \"word\"""", | ||
actual = TEXT_WITH_QUOTES | ||
.removeAndroidMirroringFormat() | ||
.convertXmlStringToAndroidLocalization() | ||
) | ||
} | ||
|
||
private companion object { | ||
private const val TEXT_WITH_QUOTES = """Same text with symbol's @ ? somet\'ing \"word"""" | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
samples/compose-resources-gallery/shared/src/commonMain/moko-resources/base/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<resources> | ||
<string name="hello_world">Hello moko-resources World</string> | ||
<string name="new_line_test">Text with | ||
<string name="new_line_test">@Text with | ||
newline w/o new line</string> | ||
<string name="symbols_text">Text \n with " ' % @ * & {} "same" inch's</string> | ||
<string name="symbols_text">Text \n with " ' % @ * & {} "same\" inch\'s</string> | ||
<string name="font_style_text">Text with <b>bold</b>, <i>italic</i>, <u>underline</u></string> | ||
</resources> |
2 changes: 1 addition & 1 deletion
2
samples/compose-resources-gallery/shared/src/commonMain/moko-resources/ru/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<resources> | ||
<string name="hello_world">Привет Мир moko-resources</string> | ||
<string name="symbols_text">Текст \n с " ' % @ * & {} "сколько-то" дюйм'ов</string> | ||
<string name="symbols_text">Текст \n с " ' % @ * & {} "сколько-то\" дюйм\'ов</string> | ||
<string name="font_style_text">Текст с <b>жирный</b>, <i>курсив</i>, <u>подчеркивание</u></string> | ||
</resources> |