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

PropertyKey is not working for RessourceBundle #13

Closed
Mosch0512 opened this issue Apr 30, 2019 · 2 comments
Closed

PropertyKey is not working for RessourceBundle #13

Mosch0512 opened this issue Apr 30, 2019 · 2 comments

Comments

@Mosch0512
Copy link

Mosch0512 commented Apr 30, 2019

When i add a new properties file to my project inside resources and name it as for example "lang1" than the BUNDLE_NAME is recognized correctly.

But if i add an ResourceBundle containing lang2_de and lang2_en and try to use its base name as BUNDLE_NAME it shows me the following error "Invalid resource bundle reference 'lang2'.

So i basically have 3 files.

lang1_de.properties
lang2_de.properties
lang2_en.properties

lang2 is bundled into an Resource Bundle with "'base name' = lang2"

This is working:

private const val BUNDLE_NAME = "lang1"

fun foo(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String): String {
    return key
}

This is not:

private const val BUNDLE_NAME = "lang2"

fun foo(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String): String {
    return key
}

But if i do the same thing with java it is working ...

private static final String BUNDLE_NAME = "lang2";

public static void foo(@PropertyKey(resourceBundle = BUNDLE_NAME) String key) {
    return key;
}

I am doing this for getting the information about my properties being used inside my code.

The properties are marked correctly inside the property files for both examples.

But for lang2 the strings used inside the code are all shown with inspection error "String literal 'testprop' doesn't appear to be valid property key ..."

Also see my issue at stackoverflow:
https://stackoverflow.com/questions/55915462/propertykey-cant-handle-resource-bundles

@amaembo
Copy link
Collaborator

amaembo commented May 8, 2019

Hello! This repository is about annotations themselves, not about their support in IntelliJ IDEA or any other IDE. If you feel you hit the bug in IntelliJ IDEA, please report it to https://youtrack.jetbrains.com/issues . Thanks.

@amaembo amaembo closed this as completed May 8, 2019
@CrazyCoder
Copy link
Member

I've added https://youtrack.jetbrains.com/issue/KT-31359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants