Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Soy Caching breaks i18n in my plugin

ConradR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2013

In my soy templates I use

{getText('com.foo.header')}

for i18n. The keys are available both in English and German. There seems to be a problem with caching:

If the template is rendered the first time for a user with a German locale, all other users will see the German text. This cache is valid until I reinstall the plugin. This just affects localized texts but not other dynamic data.

Example (with Fritz and James, who use different browsers):

  1. Deploy
  2. Fritz opens the page -> German
  3. James opens the Page - > German
  4. Deploy
  5. James opens the Page -> English
  6. Fritz opens the Page -> English

There seem to be issues with caching: https://answers.atlassian.com/questions/108544/disabling-soy-caching

But I can't reproduce this problem with Soy Templates used by Atlassian. It occurs both on a dev and a production system. Am I missing something?

Jira 5.1.8

<component-import key="soyTemplateRenderer" interface="com.atlassian.soy.renderer.SoyTemplateRenderer"/>

    <web-resource name="foo" key="foo">


        <!-- transform calls to AJS.getText() inside JS files -->
        <transformation extension="js">
            <transformer key="jsI18n"/>
        </transformation>

        <!-- Make available to the client-side in JS as well... -->
        <transformation extension="soy">
            <transformer key="soyTransformer"/>
        </transformation>
        <resource type="download" name="MyStatus.soy.js" location="/templates/status/mystatus.soy"/>

        <context>atl.general</context>
    </web-resource>

1 answer

0 votes
ConradR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2013

Hm, I didn't find any difference to the way Atlassian uses Soy besides the missing

<property key="content-type" value="text/javascript"/>

But setting the content-type didn't help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events