Localize an App
<translations:localize>
JSP tag to load a set of UI label translations into an app. The tag syntax is:dictionary
. Name of the resource bundle from which to load translations. This is also the first part of the name of each property file that contains translations.
Default: translations
locale
. Locale
Default: en
(English)
dictionary
and locale
are used to find the file as follows:src/main/resources
, the Appkit translation service looks for a resource bundle named dictionary
, for example, translations
.{resource}
, for example, for the files translations_en.properties
and translations_fr.properties
.src/main/resources
directory. For example, for a dictionary called translations
add translations_en.properties
and translations_fr.properties
.translations_en.properties
:
translations_fr.properties
:
components.response-statistics.showing
is Showing {first} - {last} of {total}
in English. Translations should retain the variables, though their order might differ. Labels can use <em>
tags for emphasis, for example, More results like <em>{result}</em>
.pom.xml
:
taglib
directive at the top of your app’s index.jsp
:
<translations:localize>
JSP tag inside the <head>
element of your app’s index.jsp
:
url-rules.xml
file:
<translations:localize>
JSP tag works the same.Key | English Label | Additional Context |
---|---|---|
components.search-box.placeholder | Search… | Search input placeholder |
components.search-box.button-label | Search | Search submit button label |
components.search-box.saved | My Saved Searches | |
components.search-box.bookmark | My bookmarks | |
components.spelling-suggestions.did-you-mean | Did you mean: . | As in, “Did you mean spelling-corrected query?” |
components.spelling-suggestions.auto-correct | Showing results for . | This is displayed above a list of results of a spelling-corrected query. |
components.spelling-suggestions.no-results | No results found for . | |
components.response-statistics.showing | Showing - of | |
components.pagination.next | Next | |
components.pagination.previous | Previous | |
components.breadcrumbs.clear-all | Clear All | |
components.facet.show-more | Show more | |
components.facet.show-less | Show less | |
components.no-results.title | Sorry: there are no results that match your search criteria. | |
components.no-results.subtitle | If you have checked your spelling: try using more general keywords. | |
components.response-statistics.showing-all | Showing All | |
collaborate.bookmark.tooltip | Bookmark this? | As in, “Would you like to bookmark this item?” |
collaborate.bookmark.active | You have bookmarked this | As in, this is already bookmarked. |
collaborate.bookmark.single | person has bookmarked this | As in the singular: “1 person has bookmarked this.” |
collaborate.bookmark.plural | people have bookmarked this | As in the plural: “4 people have bookmarked this.” |
collaborate.bookmarkList.empty-text | You do not have any bookmarks yet | |
collaborate.comment.prompt | Please enter a comment | As in a prompt to add a comment. |
collaborate.comment.post | Post | The comment submit button |
collaborate.comment.placeholder | Leave a new note… | The text area placeholder |
collaborate.comment.delete | Delete | The delete comment button |
collaborate.comment.more | Show more comments | |
collaborate.comment.less | Show fewer | As in, show fewer comments. |
collaborate.comment.delete-message | Are you sure you want to remove this comment? | |
collaborate.like.tooltip | Do you like this? | As in, “Do you like this item/result?” |
collaborate.like.active | You have liked this | |
collaborate.like.singular | person has liked this | As in the singular: “1 person has liked this.” |
collaborate.like.plural | people have liked this | As in the plural “2 people have liked this.” |
collaborate.saved.button | Save | The save query button label |
collaborate.saved.empty-text | You do not have any saved queries yet | |
collaborate.saved.error | Please enter a name so this query can be saved | Error message indicating a name is required |
collaborate.saved.error-duplicate | A saved query with that name already exists, please use a different name | Error message flagging duplicate name |
collaborate.saved.error-network | Unable to save query, please try again | General error message |
collaborate.saved.placeholder | Search name | Guidance phrase in search box about searching names of saved searches |
collaborate.topic.button | Save | The save topic button label |
collaborate.topic.prompt | Please enter a topic name | |
collaborate.topic.name | Type a name for the new topic… | The text input placeholder |
collaborate.topic.description | Description… | Input placeholder for the topic description text |
collaborate.topic.empty | You do not have any topics yet | |
components.breadcrumbs.exclude | not | Showing the results that do not include items of this breadcrumb type |
components.facet.apply-filters | Apply Filters | |
components.facet.no-results | No results found | |
components.facet.search | Search… | |
content.form.success | Form posted successfully | |
content.form.error | Error!- | |
content.form.required | This field is required | |
content.form.submit | Submit | |
content.form.required-textarea | This field is required |