Confluence I18n in JavaScript resource


I’m trying to get AJS.I18n.get('de.cyclonit.confluence.plugins.test.test-macro.desc') to work in my plugin, but instead of getting the value I get the following error:

Error loading I18n for de.cyclonit.confluence.plugins.test.test-macro.desc⁠:error

The relevant part of my atlassian-plugin.xml looks like this:

    <web-resource key="test-resources" name="Test Web Resources">

        <transformation extension="js">
            <transformer key="jsI18n" />

        <resource type="download" name="test-macro-browser.js" location="/js/test-macro-browser.js"/>


my test-macro-browser-js:

AJS.toInit(function() {

and my

de.cyclonit.confluence.plugins.test.test-macro.desc = Testing

Can anyone tell me what I’m doing wrong?

Dear @christ.klinge,

you defined the overall i18n resource in your plugin.xml?

<!-- add our i18n resource -->
    <resource type="i18n" name="i18n" location="myi18nfile"/>



yes that’s in place.

<resource type="i18n" name="i18n" location="test"/>

Check your generated jar, does it contain the file?
If not, does your pom.xml contains


under the <build> tag?

Hi @Panos,

I’ve never seen that one before. For testing, I added it as a chield to the build-tag, is that correct? If so, it didn’t change anything.

Kind regards,

Yeah it should be as child of build. But you didn’t answer the other part, does your jar contain the file? You can just extract it with a zip app

Yes it does. Using the i18n-values to translate macro parameters and such does work fine too. It doesn’t work in JavaScript only.