Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Move agent instructions from `CLAUDE.md` to `AGENTS.md` so Claude Code, Codex, and other agents share one file. `CLAUDE.md` now only imports it (`@AGENTS.md`)

### Fixed
- Comments say "the agent" instead of the agent's name (renamed with the product) and drop "a"/"an" before domain words, which can't follow the first sound of the renamed word; test fixtures say "This is shop.". `StringResourcesTranslationTest` now fails on "a" or "an" before a domain word or the product name in an English string
- Error messages are in the app language and say what the user can do, with the same wording as NativeAppTemplate-Free-iOS; the error codes are unchanged. A request that got no answer (no network, a timeout) or an error status without a message (e.g. a 502 page) shows `[NATIVEAPPTEMPLATE-2002]` "Something went wrong while communicating with the server. Please try again later." (サーバーとの通信中に問題が発生しました。しばらくしてからもう一度お試しください。) instead of the English system text (e.g. "Processing error: Unable to resolve host ..." or "Processing error: HTTP 502"). A response the app could not process (`2002`) and `1001` show "An unexpected error occurred." (予期しないエラーが発生しました。). The server's own messages are shown as is, without the developer suffix " [Status: 422]" (`2001`) or the "Processing error: " prefix (sign-in's "Invalid login credentials"). The details are logged with the code instead (`adb logcat -s ApiError`)
- An error snackbar no longer stays after the screen recovers (e.g. the offline `[NATIVEAPPTEMPLATE-2002]` error still showing after the network is back and Reload succeeded). Every screen's load (Reload, pull to refresh, resume) and every sign-in attempt now clears the previous attempt's error when it starts, which closes its snackbar; an error of the new attempt still shows. Ported from MyTurnTagCreator-Android #139
- The "Shop deleted" notice no longer stays over the sign-in screen after signing out. The notices stored before the app restarts itself are about the session, so signing out closes the one still on screen (`showNoticeStoredForLaunch`); the notices that explain a sign-out (email changed, account deleted) are unchanged. Ported from MyTurnTagCreator-Android #143
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Japanese. Keep every translatable key of values/strings.xml here (StringResourcesTranslationTest
fails otherwise), and use the terms of the template API's config/locales/ja.yml:
Shop = 店舗, Item Tag = アイテムタグ, idled / completed = 未完了 / 完了.
nativeapptemplate-agent renames 店舗 and アイテムタグ as plain substrings, so always write them in
The agent renames 店舗 and アイテムタグ as plain substrings, so always write them in
full: never ショップ / 店 / お店, and never shorten アイテムタグ to タグ or アイテム.
-->
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ class StringResourcesTranslationTest {
assertTrue("Format arguments differ:\n" + mismatches.joinToString("\n"), mismatches.isEmpty())
}

// The agent renames the domain words and the product name, so an article in front of one can't
// follow the new word's first sound.
@Test
fun english_hasNoArticleBeforeRenamedWords() {
val article = Regex("""\ban? (item tags?|shops?|shopkeepers?|NativeAppTemplate)\b""", RegexOption.IGNORE_CASE)
val texts = english.mapValues { it.value.text } +
englishPlurals.flatMap { (name, items) -> items.map { (quantity, text) -> "$name/$quantity" to text } }
val wrong = texts.filterValues { article.containsMatchIn(it) }.keys
assertTrue("Drop the article before the renamed word in: $wrong", wrong.isEmpty())
}

@Test
fun plurals_matchBetweenEnglishAndJapanese() {
assertEquals(englishPlurals.keys, japanesePlurals.keys)
Expand Down Expand Up @@ -75,7 +86,7 @@ class StringResourcesTranslationTest {

@Test
fun japanese_shopIs店舗() {
// nativeapptemplate-agent renames 店舗 as a plain substring, so a shop must never be ショップ,
// The agent renames 店舗 as a plain substring, so shop must never be ショップ,
// 店 or お店, or a generated app would keep this template's word.
val katakana = japanese.filterValues { "ショップ" in it.text }.keys
assertTrue("Use 店舗: $katakana", katakana.isEmpty())
Expand All @@ -85,7 +96,7 @@ class StringResourcesTranslationTest {

@Test
fun japanese_neverShortensアイテムタグ() {
// nativeapptemplate-agent renames アイテムタグ as a plain substring, so an item tag must always be
// The agent renames アイテムタグ as a plain substring, so item tag must always be
// written in full; a bare タグ or アイテム would survive the rename.
val shortened = japanese.filterValues { resource ->
val rest = resource.text.replace("アイテムタグ", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class ShopDetailViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private var testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class ShopBasicSettingsViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private val testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ShopSettingsViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private val testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ItemTagCreateViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private var testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class ItemTagListViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private var testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class ShopCreateViewModelTest {
private const val SHOP_TYPE = "shop"
private const val SHOP_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1A"
private const val SHOP_NAME = "8th & Townsend"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private val testInputShopsData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private const val SHOP_3_ID = "5712F2DF-DFC7-A3AA-66BC-191203654A1C"
private const val SHOP_1_NAME = "8th & Townsend"
private const val SHOP_2_NAME = "Kansas & 16th St"
private const val SHOP_3_NAME = "Safeway San Francisco 1490"
private const val SHOP_DESCRIPTION = "This is a shop."
private const val SHOP_DESCRIPTION = "This is shop."
private const val SHOP_TIME_ZONE = "Pacific Time (US & Canada)"

private val testInputShopsData = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ModelJsonTest {
assertEquals(7, shop.getCompletedItemTagsCount())
}

// A shop without the optional attributes falls back to the defaults (iOS ShopAdapter: "" and 0).
// Shop without the optional attributes falls back to the defaults (iOS ShopAdapter: "" and 0).
@Test
fun shop_withoutOptionalAttributes_usesTheDefaults() {
val shop = json.decodeFromString<Shop>("""{"data": {"id": "shop-1", "type": "shop", "attributes": {"name": "Fox Plaza"}}}""")
Expand Down
Loading