Skip to content

Fix check_app_name.sh: resolve FIXMEs and TODOs from #2118#3126

Open
Geet42 wants to merge 1 commit into
CatimaLoyalty:mainfrom
Geet42:fix/check-app-name-script
Open

Fix check_app_name.sh: resolve FIXMEs and TODOs from #2118#3126
Geet42 wants to merge 1 commit into
CatimaLoyalty:mainfrom
Geet42:fix/check-app-name-script

Conversation

@Geet42
Copy link
Copy Markdown

@Geet42 Geet42 commented May 11, 2026

Fixes #2118

  • Replaced global-variable-dependent check() function with per-pass inline logic
  • Added cross-check between title.txt and strings.xml app_name per language
  • Fixed subtitle stripping to handle em dash (—) and en dash (–) variants used in some title.txt files
  • Added warning for strings that hardcode 'Catima' instead of using @string/app_name
  • Fixed comma bug in ALLOWLIST array ("peo," -> "peo")

Comment on lines 15 to +16
# peo is only temporarily allowed due to https://github.com/WeblateOrg/weblate/issues/17455
ALLOWLIST=("ar" "bn" "fa" "fa-IR" "he-IL" "hi" "hi-IN" "kn" "kn-IN" "ml" "mr" "peo", "ta" "ta-IN" "zh-rTW" "zh-TW") # TODO: Link values and fastlane with different codes together
ALLOWLIST=("ar" "bn" "fa" "fa-IR" "he-IL" "hi" "hi-IN" "kn" "kn-IN" "ml" "mr" "peo" "ta" "ta-IN" "zh-rTW" "zh-TW")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given WeblateOrg/weblate#17455 is fixed this may be a good moment to remove peo :)

Comment on lines -10 to +9
NC='\033[0m' # No Color
NC='\033[0m'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you removed these comments? They're kinda helpful in understanding the code better.

Comment on lines -20 to +25
LANG=${LANG_DIRNAME#values-} # Fetch lang name
LANG=${LANG#values} # Handle "app/src/main/res/values"
LANG=${LANG:-en} # Default to en
LANG=${LANG_DIRNAME#values-}
LANG=${LANG#values}
LANG=${LANG:-en}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you removed these comments? They're kinda helpful in understanding the code better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an improvement from a quick look. I can also confirm that Fastlane and values.xml get correctly compared. For example, if I manually change it: Error: lang 'lt' title.txt app name='Catapp' does not match strings.xml app_name='Catima'.

I think it still needs a bit of extra logic to deal with stuff like es in values being es-ES in Fastlane and zh-rCN in values being zh-CN in Fastlane. I think we can probably automatically link most of those for more thorough checking.

I'll look a bit deeper into this later but it seems a great help and it's great that it also detects all the places I wrongly hardcoded it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write CI to protect app_name

2 participants