admin管理员组

文章数量:1201590

I need to upgrade an old JIRA plugin to the latest SDK. At the moment I have problems, that the locales are not loaded correctly.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
    <ModulePrefs 
        title="__MSG_gadget.my.my.title__" directory_title="__MSG_gadget.my.title__"
        description="__MSG_gadget.my.description__" author="__MSG_gadget.my.author__"  
        screenshot="#staticResourceUrl("com.test.dev.star.jira-gadget-star-plugin-combined-two:dev-gadget", "Starscreenshot.png")"
        thumbnail="#staticResourceUrl("com.test.dev.star.jira-gadget-star-plugin-combined-two:dev-gadget", "thumbnail.png")">
        <Optional feature="gadget-directory">
            <Param name="categories">
                JIRA
            </Param>
        </Optional>


        <Optional feature="atlassian.util" />
        <Optional feature="auth-refresh" />
        <Optional feature="dynamic-height" />
        #oauth
        <Require feature="views" />
        <Require feature="settitle"/>
        <Require feature="oauthpopup" />
        <Require feature="setprefs" />
        <Locale messages="__ATLASSIAN_BASE_URL__/download/resources/com.test.dev.star.jira-gadget-star-plugin-combined-two/i18n/ALL_ALL.xml"/>
        #supportedLocales("gadgetmon,gadget.introduction")
    </ModulePrefs>

    <UserPref name="isConfigured" datatype="hidden" default_value="false"/>
    <UserPref name="firstTime" datatype="hidden" default_value="true"/>
    <UserPref name="projectId" display_name="Project" datatype="hidden"/>

    <Content type="html" view="profile">
        <![CDATA[
            #requireResource("com.atlassian.jira.gadgets:common")
            #requireResource("com.atlassian.gadgets.publisher:ajs-gadgets")
            #requireResource("com.test.dev.star.jira-gadget-star-plugin-combined-two:StarImage")
            #includeResources()

        <script type="text/javascript">
            const gadget = AJS.Gadget({
            baseUrl: "__ATLASSIAN_BASE_URL__",
            config: {
                descriptor: function (args) {
                var gadget = this;
                var projectPicker = AJS.gadget.fields.projectPicker(
                    gadget,
                    "projectId",
                    args.projectOptions
                );

                return {
                    theme: (function () {
                    if (gadgets.window.getViewportDimensions().width < 450) {
                        return "gdt top-label";
                    } else {
                        return "gdt";
                    }
                    })(),
                    fields: [projectPicker, AJS.gadget.fields.nowConfigured()],
                };
                },
                args: (function () {
                return [
                    {
                    key: "projectOptions",
                    ajaxOptions: "/rest/gadget/1.0/filtersAndProjects?showFilters=false",
                    },
                ];
                })(),
            },
            view: {
                template: function (args) {
                },
            },
            });

        </script>

        ]]> 
    </Content>
</Module>

The save button is empty, all titles have MSG_gadget.my.title inside instead of the name. How I can find out what's the problem is? When I move the position of supportedLocales in the code more up, the save button is shown correctly, but order string are not shown. If I'm moving it down, other strings are shown, but the save button is not working. I have some kind of initialization problem in my plugin.

MSG_gadget.my.title By MSG_gadget.my.author • Local

MSG_gadget.my.description

本文标签: JIRA Gadget not loading localesStack Overflow