{"id":454,"date":"2016-03-05T16:08:40","date_gmt":"2016-03-05T15:08:40","guid":{"rendered":"http:\/\/elstarit.nl\/?p=454"},"modified":"2016-03-05T16:08:40","modified_gmt":"2016-03-05T15:08:40","slug":"xpages-tip-multi-language-support-for-labels","status":"publish","type":"post","link":"https:\/\/elstarit.nl\/?p=454","title":{"rendered":"XPages tip: Multi language support for labels"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-462\" src=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg\" alt=\"multi language\" width=\"800\" height=\"500\" srcset=\"https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg 800w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage-300x188.jpg 300w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage-768x480.jpg 768w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage-400x250.jpg 400w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/>Back in 2014 I wrote a blog about <a href=\"http:\/\/elstarit.nl\/2014\/10\/01\/control-labels-xpage-app\/\" target=\"_blank\">controlling the labels in a XPages application<\/a>, via a web interface, backed by a property file which is inside the application.<\/p>\n<p>One of the most wanted requests was multi language support. So I added configurable multi language support to my applications. I used it at several projects with success.<\/p>\n<p><strong>Language web interface<\/strong><\/p>\n<p>I added 2 pages to my administration part of the application, an language overview page and language page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-474\" src=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List.png\" alt=\"Language List\" width=\"2392\" height=\"642\" srcset=\"https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List.png 2392w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List-300x81.png 300w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List-768x206.png 768w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List-1024x275.png 1024w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-List-931x250.png 931w\" sizes=\"auto, (max-width: 2392px) 100vw, 2392px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-475\" src=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-page-300x209.png\" alt=\"language page\" width=\"300\" height=\"209\" srcset=\"https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-page-300x209.png 300w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-page-359x250.png 359w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-page.png 758w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>When the language page will be saved, there is a check if it is a new language. If yes it will be added to the language list in my application bean AND it will create for this new language all the property documents, from the property file, with the Language stored in the property document.<\/p>\n<p>As you can see, in the overview there are other interesting buttons.<\/p>\n<ul>\n<li>Delete languages, will delete the selected languages, but also remove the property documents for the removed language.<\/li>\n<li>Load languages will load all the property documents for the languages present in the overview.<\/li>\n<li>Make default, there can be only one default language. I store the language preference in the User Preference document. When the user have no language preference set, it will take the default language.<\/li>\n<\/ul>\n<p>All the property documents have now a language field.<\/p>\n<p><strong>Make it work<\/strong><\/p>\n<p>In the top bar of the application I have added an dropdown where the language codes are loaded.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-473\" src=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-dropdown-300x224.png\" alt=\"Language dropdown\" width=\"300\" height=\"224\" srcset=\"https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-dropdown-300x224.png 300w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-dropdown-335x250.png 335w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/Language-dropdown.png 370w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The preferred language of the user will be loaded first, when no preferred language is present the default language will be loaded.<\/p>\n<p>When you select another language, the new language will be stored in the User preference document and the properties of the new language will be loaded.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Backend changes<\/strong><\/p>\n<p>In the backend classes, like the PropertyHandler, I added the language to the key in the methods who are getting the property value for that language.<\/p>\n<p>And of course store the preferred language to the users preferences file.<\/p>\n<p>So no big changes to the backend classes.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in 2014 I wrote a blog about controlling the labels in a XPages application, via a web interface, backed by a property file which is inside the application. One of the most wanted requests was multi language support. So I added configurable multi language support to my applications. I used it at several projects <a class=\"read-more\" href=\"https:\/\/elstarit.nl\/?p=454\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[2],"tags":[29,66,3,12],"class_list":["post-454","post","type-post","status-publish","format-standard","hentry","category-development","tag-bootstrap","tag-development","tag-java","tag-xpages"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>XPages tip: Multi language support for labels - elstar IT<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elstarit.nl\/?p=454\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"XPages tip: Multi language support for labels - elstar IT\" \/>\n<meta property=\"og:description\" content=\"Back in 2014 I wrote a blog about controlling the labels in a XPages application, via a web interface, backed by a property file which is inside the application. One of the most wanted requests was multi language support. So I added configurable multi language support to my applications. I used it at several projects Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elstarit.nl\/?p=454\" \/>\n<meta property=\"og:site_name\" content=\"elstar IT\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-05T15:08:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg\" \/>\n<meta name=\"author\" content=\"flinden68\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"flinden68\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454\"},\"author\":{\"name\":\"flinden68\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\"},\"headline\":\"XPages tip: Multi language support for labels\",\"datePublished\":\"2016-03-05T15:08:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454\"},\"wordCount\":344,\"commentCount\":4,\"image\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/elstarit.nl\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/multilanguage.jpg\",\"keywords\":[\"bootstrap\",\"development\",\"java\",\"xpages\"],\"articleSection\":[\"development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/elstarit.nl\\\/?p=454#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454\",\"url\":\"https:\\\/\\\/elstarit.nl\\\/?p=454\",\"name\":\"XPages tip: Multi language support for labels - elstar IT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/elstarit.nl\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/multilanguage.jpg\",\"datePublished\":\"2016-03-05T15:08:40+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elstarit.nl\\\/?p=454\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#primaryimage\",\"url\":\"http:\\\/\\\/elstarit.nl\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/multilanguage.jpg\",\"contentUrl\":\"http:\\\/\\\/elstarit.nl\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/multilanguage.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=454#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elstarit.nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"development\",\"item\":\"https:\\\/\\\/elstarit.nl\\\/?cat=2\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"XPages tip: Multi language support for labels\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#website\",\"url\":\"https:\\\/\\\/elstarit.nl\\\/\",\"name\":\"elstar IT\",\"description\":\"Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elstarit.nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\",\"name\":\"flinden68\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"caption\":\"flinden68\"},\"sameAs\":[\"http:\\\/\\\/www.elstarit.nl\",\"https:\\\/\\\/x.com\\\/elstarit\"],\"url\":\"https:\\\/\\\/elstarit.nl\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XPages tip: Multi language support for labels - elstar IT","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elstarit.nl\/?p=454","og_locale":"en_US","og_type":"article","og_title":"XPages tip: Multi language support for labels - elstar IT","og_description":"Back in 2014 I wrote a blog about controlling the labels in a XPages application, via a web interface, backed by a property file which is inside the application. One of the most wanted requests was multi language support. So I added configurable multi language support to my applications. I used it at several projects Read More","og_url":"https:\/\/elstarit.nl\/?p=454","og_site_name":"elstar IT","article_published_time":"2016-03-05T15:08:40+00:00","og_image":[{"url":"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg","type":"","width":"","height":""}],"author":"flinden68","twitter_misc":{"Written by":"flinden68","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elstarit.nl\/?p=454#article","isPartOf":{"@id":"https:\/\/elstarit.nl\/?p=454"},"author":{"name":"flinden68","@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935"},"headline":"XPages tip: Multi language support for labels","datePublished":"2016-03-05T15:08:40+00:00","mainEntityOfPage":{"@id":"https:\/\/elstarit.nl\/?p=454"},"wordCount":344,"commentCount":4,"image":{"@id":"https:\/\/elstarit.nl\/?p=454#primaryimage"},"thumbnailUrl":"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg","keywords":["bootstrap","development","java","xpages"],"articleSection":["development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/elstarit.nl\/?p=454#respond"]}]},{"@type":"WebPage","@id":"https:\/\/elstarit.nl\/?p=454","url":"https:\/\/elstarit.nl\/?p=454","name":"XPages tip: Multi language support for labels - elstar IT","isPartOf":{"@id":"https:\/\/elstarit.nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/elstarit.nl\/?p=454#primaryimage"},"image":{"@id":"https:\/\/elstarit.nl\/?p=454#primaryimage"},"thumbnailUrl":"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg","datePublished":"2016-03-05T15:08:40+00:00","author":{"@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935"},"breadcrumb":{"@id":"https:\/\/elstarit.nl\/?p=454#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elstarit.nl\/?p=454"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/elstarit.nl\/?p=454#primaryimage","url":"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg","contentUrl":"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/03\/multilanguage.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/elstarit.nl\/?p=454#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elstarit.nl\/"},{"@type":"ListItem","position":2,"name":"development","item":"https:\/\/elstarit.nl\/?cat=2"},{"@type":"ListItem","position":3,"name":"XPages tip: Multi language support for labels"}]},{"@type":"WebSite","@id":"https:\/\/elstarit.nl\/#website","url":"https:\/\/elstarit.nl\/","name":"elstar IT","description":"Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elstarit.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935","name":"flinden68","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","caption":"flinden68"},"sameAs":["http:\/\/www.elstarit.nl","https:\/\/x.com\/elstarit"],"url":"https:\/\/elstarit.nl\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454"}],"version-history":[{"count":57,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":515,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions\/515"}],"wp:attachment":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}