Plugin i18n

Andrew Pechnikov
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.
September 3, 2012

Hello!

I've developed plugin and now it's time to internatiolize it.

<resource type="i18n" name="i18n" location="croc.apechnikov.PrTab"/> in atlassian-plugin.xml
ADDED

in package .../resources/croc/apechnikov/ I have 2 files: PrTab.properties and PrTab_ru_RU.properties.
But my plugin isn't translated at all!

Do you have any versions why?

2 answers

1 accepted

0 votes
Answer accepted
Andrew Pechnikov
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.
September 13, 2012

I've found an answer. Nowhere was written that PrTab.properties and PrTab_ru_RU.properties must be identical(((( that's a very stupid fail

Jobin Kuruvilla [Adaptavist]
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.
September 13, 2012

Interesting. What do you mean by identical? Can have only same properties?

jan.dolezal September 13, 2012

I am using not identical files and its working just fine.

Andrew Pechnikov
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.
September 14, 2012

Jobin, yes. When i did them the same, everything began to work.
Jan, that's strange.

0 votes
Jobin Kuruvilla [Adaptavist]
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.
September 3, 2012

Is it reading the key values? If it is only the transition which is failing, are you using the correct language?

Jobin Kuruvilla [Adaptavist]
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.
September 3, 2012

And you have Russian selected in your user profile?

Andrew Pechnikov
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.
September 3, 2012

yes, it is, but only from PrTab.properties and not from PrTab_ru_RU.properties for Russian language. I'm programming this plugin for multiple languages if this may help.

Andrew Pechnikov
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.
September 3, 2012

Yes, i have but still don't works. I think there some problems with identifying PrTab_ru_RU.properties. May be i need somewhere in atlassian-plugin xml type something that tells jira to use PrTab_ru_RU.properties when language is set to russian?

Jobin Kuruvilla [Adaptavist]
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.
September 3, 2012
Jobin Kuruvilla [Adaptavist]
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.
September 3, 2012

Wherever you need translation, use the resolver's getText method.

Andrew Pechnikov
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.
September 3, 2012

I've imported I18N resolver module, but i need translation only in plugin description and in velocity templates.

Andrew Pechnikov
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.
September 3, 2012

protected Map createVelocityParams(BrowseContext ctx)

{

Map params = JiraVelocityUtils.getDefaultVelocityParams(super.createVelocityParams(ctx), authenticationContext);

.........some code.........

params.put("1111key",i18nResolver.getText("internationalized.greeting"));

return params;

}

View template:

$i18n.getText("key.value")

$1111key
nothing works((

Andrew Pechnikov
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.
September 13, 2012

Jobin, thank you very much for your help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events