This repository was archived by the owner on Apr 22, 2024. It is now read-only.
  
  
  - 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 40
 
i18n:report overlooks missing in ts file #247
Copy link
Copy link
Open
Description
Reporting a bug?
If i use a i18n in a pure ts file in my assets foulder the Missing Entry detection from i18n:report doesn't work correctly:
import i18n from "@/i18n";
const { t } = i18n.global;
export const Toasts = {
    debug(message: string) {
        # detected
        debugToast(message, t("toast.Debug"))
    },
    registered() {
        # NOT detected
        infoToast(t("toast.register"))
    },
    unregistered() {
        # detected
        infoToast( t("toast.unregister"))
    },
}> vue-cli-service i18n:report --src "./src/assets/ts/helpers/toasts*.ts" --locales "./src/locales/**/*.json" --type missing
┌────┬────────────┬────────────────────────────────────────┬────────┬──────────────────────────────┐
│ #  │ Language   │ File                                   │ Line   │ Missing i18n Entry           │
├────┼────────────┼────────────────────────────────────────┼────────┼──────────────────────────────┤
│ 0  │ de         │ /src/assets/ts/helpers/toasts.ts       │ 50     │ toast.Debug                  │
│ 1  │ de         │ /src/assets/ts/helpers/toasts.ts       │ 56     │ toast.unregister             │
│ 2  │ en         │ /src/assets/ts/helpers/toasts.ts       │ 50     │ toast.Debug                  │
│ 3  │ en         │ /src/assets/ts/helpers/toasts.ts       │ 56     │ toast.unregister             │
└────┴────────────┴────────────────────────────────────────┴────────┴──────────────────────────────┘
And yes toast.register is definitly not defined anywhere!
It seems that if there is no space infront of  the t then its not detected -.- But with correct Formating must not be a space... so hmm.... not perfect...
Version
"vue-i18n": "^9.1.0",
Expected behavior
The not detected one in the example should be detected...
Reproduction
like in the minimal example
System Info
System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
    Memory: 1.45 GB / 15.53 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.3 - /usr/local/bin/node
    npm: 7.20.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 94.0.4606.61
    Firefox: 92.0
  npmPackages:
    vue: ^3.0.0 => 3.0.11 
    vue-i18n: ^9.1.0 => 9.1.6Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
 - Read the Documentation
 - Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
 - Check that this is a concrete bug. For Q&A open a GitHub Discussion
 
Metadata
Metadata
Assignees
Labels
No labels