slang-i18n/slang

`analyze` does not detect translation key usage when keys are accessed via intermediate variables

Open

#310 建立於 2025年7月10日

在 GitHub 查看
 (5 留言) (4 反應) (0 負責人)Dart (62 fork)github user discovery
bughelp wanted

倉庫指標

Star
 (606 star)
PR 合併指標
 (PR 指標待抓取)

描述

Describe the bug When running the analyze --full command, the tool fails to recognize translation key usage if keys are accessed through intermediate variables.

To Reproduce

  1. Access a translation key with chained access (works fine):

    context.t.section.subsection.key
    
  2. Assign intermediate variables:

    final tSection = context.t.section;
    final tSub = tSection.subsection;
    

    Then use:

    tSub.key
    
  3. The analyze --full command incorrectly marks the key as unused.

Expected behavior Keys accessed via intermediate variables are not detected and are incorrectly flagged as unused.

貢獻者指南