Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`no-duplicate-message-in-locale' rule #8

Open
kazupon opened this issue May 10, 2019 · 2 comments
Open

`no-duplicate-message-in-locale' rule #8

kazupon opened this issue May 10, 2019 · 2 comments
Labels
Priority: Low Status: Need More Info Lacks enough info to make progress Type: Feature Includes new features

Comments

@kazupon
Copy link
Member

kazupon commented May 10, 2019

No description provided.

@kazupon kazupon added Type: Feature Includes new features Status: PR Welcome Welcome to Pull Request labels May 10, 2019
@kazupon kazupon added the Rule label Jun 14, 2019
@kazupon kazupon removed the Rule label Jan 22, 2020
@kazupon kazupon changed the title `no-duplicate-message' rule `no-duplicate-message-in-locale' rule Aug 11, 2020
@ota-meshi
Copy link
Member

Hi @kazupon!

I think this rule is probably better off not determining if it's a duplicate message for each locale.

For example, English and Japanese messages about dates may use the same message but have different meanings.

e.g.

en:
  month: Month
  short_sun: S # duplicate?
  short_mon: M
  short_tue: T # duplicate?
  short_wed: W
  short_thu: T # duplicate?
  short_fri: F
  short_sat: S # duplicate?
ja:
  month: 月 # duplicate?
  short_sun: 
  short_mon: 月 # duplicate?
  short_tue: 
  short_wed: 
  short_thu: 
  short_fri: 
  short_sat: 

In my opinion, it may be possible to reduce false positives by reporting only if there are duplicates in all locales:

en: 
  key1: dupe_message1 # Will report it
  key2: dupe_message1 # Will report it
  key3: dupe_message2 # Do not report it because it is not duplicated in "ja"
  key4: dupe_message2 # Do not report it because it is not duplicated in "ja"
ja:
  key1: 重複_メッセージ1 # Will report it
  key2: 重複_メッセージ1 # Will report it
  key3: メッセージ3
  key4: メッセージ4

Even then, it may still incorrectly report the same string message with different meanings.
What do you think?

@kazupon
Copy link
Member Author

kazupon commented Aug 12, 2020

Indeed. 🤔
Regarding duplicate messages, it's probably best not to add a rule, so that there are cases where the meaning defference depending on the context of the application and the language.

In about this rule, let's keep the pending.

@kazupon kazupon added Priority: Low Status: Need More Info Lacks enough info to make progress and removed Status: PR Welcome Welcome to Pull Request labels Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Status: Need More Info Lacks enough info to make progress Type: Feature Includes new features
Projects
None yet
Development

No branches or pull requests

2 participants