Skip to content

[Feature]: Use Foundation to select localized app names #1209

Closed as not planned

Description

@DCjanus

What should it do?

Could Tinycast choose app names from the localization identifiers a bundle actually provides?

  • Tag expansion (today): BundleLocalization.indexedLanguages builds possible resource names from a preferred language tag. #470 added a form for zh_CN. #1135 added one for zh-Hans. Both fixes work, but another resource spelling may need another rule.
  • Foundation selection (idea): Read the identifiers in InfoPlist.loctable and .lproj folders. Then use Bundle.preferredLocalizations(from:forPreferences:) to rank the available choices. Tinycast would still read the names from those resources.

I tried Foundation selection in a personal fork of Tinycast. The link is a record of the experiment, not a proposed PR. I have used the fork daily for about two weeks as a Simplified Chinese user. I have not noticed clear problems with app names, search, or speed. This is usage feedback, not full validation.

Why does it belong in Tinycast?

The goal is to reduce the long-term cost of maintaining tag expansion. Apple's Foundation API can rank the localizations a bundle provides. Tinycast would still filter by language and script, read InfoPlist.loctable, and keep English as a search alias.

Two tradeoffs need a decision:

  • Fallback: With zh-Hans-US, Foundation selection can choose zh_CN if that is the app's only Simplified Chinese name. Tag expansion does not. Find apps named only in a zh-Hans folder by that name #1135 deliberately kept that narrower behavior. Would this fallback be acceptable?
  • Cost: In a local benchmark on macOS 26.7, an uncached name lookup across 131 apps took about 116 ms with Foundation selection and 40 ms with tag expansion. The filesystem was warm, but Tinycast's name cache was bypassed. Resource-directory reads caused most of the difference. With the name cache reused, both took about 0.35 ms. These are name-lookup times, not palette-open times.

The fork prototype was written with AI help. I have no macOS app-development experience, so I am not submitting that code for review. I do not want to put its validation work on you. I am sharing the findings and usage feedback instead, and I can help test a solution. This issue is about app names, not Tinycast's interface language.

Activity

  1. github-actions commented on Sep 28, 2026

    @github-actions

    Thanks for opening this.

    A few things worth knowing up front:

    Tinycast aims to stay small and focused, so it is extremely selective about new
    features. Every request is read, and the ideas that truly matter are the ones taken on.
    Smaller conveniences are usually closed.

    Warning

    Don't write code for this yet. This issue has to be labelled approved first.

    1. Wait for a maintainer to add the approved label. That label is the only green light —
      a reply, a reaction or silence is not one.
    2. Once it's there, open your pull request with Closes #1209 in the description.
    3. A pull request whose linked issue isn't approved is closed automatically, unreviewed.

    Docs-only changes (*.md, docs/, website/) skip this and need no approval.

    Thanks for opening this! A maintainer will take a look soon.

  2. changed the title [-][Feature]: Explore bundle-aware app-name localization to reduce maintenance[/-] [+][Feature]: Reduce app-name localization mapping maintenance[/+] on Sep 28, 2026
  3. changed the title [-][Feature]: Reduce app-name localization mapping maintenance[/-] [+][Feature]: Use Foundation to select localized app names[/+] on Sep 28, 2026
  4. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    I also looked at FileManager.displayName(atPath:) as a simpler way to get the localized app name. Then I found #371, which already documents a case where it falls short: on a Portuguese (pt-BR) Mac, Finder and Spotlight showed Find My as Buscar, but displayName(atPath:) returned Find My.app in the reproduction.

    That result does not mean the API fails for every app. It does show why I would not assume it can replace the current name lookup. It also returns only one name, while Tinycast keeps other names, including English, searchable. The suggestion in this issue is to simplify how Tinycast selects an app's available localizations, while still reading the names from InfoPlist.loctable and .lproj/InfoPlist.strings.

  5. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    Thanks for the reply. To clarify my earlier point: #1135 fixes one case, while this suggestion aims to reduce similar app-name issues across all languages.

    Tinycast could read the localization identifiers each app actually provides and use Foundation to choose among them, instead of adding rules for each spelling.

    The scope is app-name matching. It doesn’t involve Tinycast’s interface language or require another Chinese-specific rule.

  6. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    i am kinda tired fixing, can you go through whole project if anything else breaking for chinese? why do you guys have endless stuffs?

  7. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    i changed my mind i am taking partial code from happy-proto#3

  8. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    @DCjanus i just want to end chinese chapter once and for good. i dont understand Chinese. i had to rewrote the whole search ranking aglo becasue i made chnages for so much chinese and it becasue biased towards chinese.

  9. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    @DCjanus i will put localization after notary. but what else left that doesnt work for chinese people? i am totally tired of fixing and i want to end chinese chapter closed for good.

  10. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    Thanks for taking a look at app-name localization after notarization. I can see how tiring it is to handle issues responsibly in a language you don’t speak, and I appreciate the effort.

    I don’t have many other suggestions. From your reply that Tinycast would stay English and later comment that localization was not planned, I had understood that Chinese UI translation wasn’t in scope at the time. So I maintain it in my personal fork and don’t plan to submit it upstream. The description of PR #3 is in Chinese because it is in my personal fork; I’m happy to explain any part in English.

    I haven’t noticed any other Chinese-specific problems in my own use so far, though I haven’t audited the whole project. Thank you for making Tinycast open source—it’s a great tool.

  11. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    One small suggestion: a short “Non-goals” list in the README, or a pinned issue authored and maintained by you, could make the project’s boundaries clearer. Keeping those decisions in a place you control might save you from having to explain them repeatedly.

  12. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    I get it—these localization edge cases can drive anyone a little crazy. Even as a Chinese speaker, I sometimes lose track of the ways app bundles label their Chinese resources.

    Localization and internationalization are complex; many companies have specialized teams working on them for years. That’s why I suggested using Apple’s Foundation API for this specific task: choosing among the localization identifiers an app actually provides, instead of adding more spelling rules in Tinycast. I’m hoping it gives us a more lasting fix for this class of app-name problems.

    That should benefit users of other languages too—and be kinder to your sanity 🤞

  13. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    @DCjanus happy-proto#3 this make scan slower 43ms vs 63ms

  14. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    The slower scan is a known downside of the prototype. My benchmark also found slower uncached name lookups, though it measured a different path. I’m not sure whether the extra ~20 ms in your scan is acceptable for Tinycast, or whether there’s room to optimize it.

    I opened this issue because I couldn’t find an earlier discussion of this Foundation approach. Recording the tradeoff and a decision either way could save others from repeating the investigation. If it isn’t worth pursuing, feel free to close the issue.

  15. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    imma close it then! reason would be i found more drawbacks

  16. DCjanus commented on Sep 28, 2026

    @DCjanus
    Author

    I initially thought this was a straightforward idea that only affected app-name display and lookup. After your reply, I looked more closely at the code and realized it could affect ranking too. It seems more involved than I expected.

  17. abue-ammar commented on Sep 28, 2026

    @abue-ammar
    Owner

    @DCjanus yeah it is more drawbacks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions