Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Referencing the text item is performed by prefixing the texts id with % where you'd usually put the text, for example

Code Block
xml
xml
titleOriginal Search panel definition contained within a larger client:config item
linenumberstruexml
	<view id="com.cohga.html.client.main.searchView">
		<label>Search</label>
		<location>west</location>
	</view>

would be become

Code Block
xml
xml
titleLocalised Search panel definition
linenumberstruexml
	<view id="com.cohga.html.client.main.searchView">
		<label>%search.label</label>
		<location>west</location>
	</view>

To actually define the text to be used you need to create a separate client resources item

Code Block
xml
xml
titleSetting the default resource value for search label
linenumberstruexml
<client:resources>
	<resource id="search.label">Search</resource>
</client:resources>

...

However, the real point here is to allow the text to be changed for each user based on their preferred language, and the way we do that it to create another client resources item that contains the alternate text and specify what locale the user should ask for for that text to be used. To do this we duplicate the existing resources item and set a lang property for the resources, for example:

Code Block
xml
xml
titleSetting alternate resource values for search label
linenumberstruexml
<client:resources lang="sv">
	<resource id="search.label">Hitta</resource>
</client:resources>

<client:resources lang="ru">
	<resource id="search.label">находить</resource>
</client:resources>

...

Alternate configuration layout
If you need to set a lot of resources it can become quite verbose to set each item with a separate resource entry in a resources item, so as an alternative way of creating resources you can build fullstop separated items by nesting tags, for example

Code Block
xml
xml
titleAlternate resource syntax
linenumberstruexml
<client:resources>
	<search>
		<label>Search</label>
		<tooltip>
			<title>Search</title>
			<text>Search for an entity</text>
		<tooltip>
	</search>
</client:resources>

...