easy-i18n icon indicating copy to clipboard operation
easy-i18n copied to clipboard

[Feature Request] Limit autocomplete to parameters annotated with a custom annotation

Open Xirado opened this issue 2 years ago • 4 comments

Really like this extension, but it's quite annoying if you have lots of entries because its distracting and could lag IntelliJ. Maybe it's possible to add an annotation for this? (As a dependency or the user could create his own)

e.g.

public void get(@I18n String path) {
...
}

Xirado avatar Apr 07 '22 14:04 Xirado

Yeah this is definitely a good idea. However, language-specific entry points must be defined to properly show i18n keys in the right places. I will use this ticket to collect language specific entry points.

Also adding this enhancement to the roadmap 👍

Language Specific Entry Points

Vue

vue-i18n: $t(), $tc()

React

i18next

PHP

Waiting for feedback

Java

Waiting for feedback

marhali avatar Apr 07 '22 15:04 marhali

@Xirado could you please specify your example more? You want to use a Java Annotation to indicate that a I18n Key has been specified? Is there a common Java library which applies i18n in that way?

marhali avatar Apr 07 '22 15:04 marhali

@marhali No i meant that the IDE will only autocomplete the i18n keys if the parameter of a method is annotated with some kind of @I18n (?) annotation

Like

public String get(String key) {
    ...
}

When i call this method, the IDE should not autocomplete the i18n keys (Not by default, but a setting would be nice)

public String get(@I18n String key) {
    ...
}

When i call this method, the IDE sees that this is for localization and show the i18n keys.

I have no idea whether this is a good idea or not, i just thought it would be a nice feature since as already mentioned, having alot of entries could lag the ide on every suggestion, even though you don't even want them

Xirado avatar Apr 07 '22 15:04 Xirado

I optimized suggestion handling with v4.0.0. However language specific entry points have not been defined yet. I put this in the long-term scope.

marhali avatar Apr 28 '22 16:04 marhali