Versions Compared

Key

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

...

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

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

would be become

xml
Code Block
xml
titleLocalised Search panel definition
linenumberstrue
xml
	<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

xml
Code Block
xml
titleSetting the default resource value for search label
linenumberstrue
xml
<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
xmlxml
titleSetting alternate resource values for search label
linenumberstrue
xml
<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
xmlxml
titleAlternate resource syntax
linenumberstrue
xml
<client:resources>
	<search>
		<label>Search</label>
		<tooltip>
			<title>Search</title>
			<text>Search for an entity</text>
		<tooltip>
	</search>
</client:resources>

...