Enable Users to View a Translated Version of an Article

You can implement the language drop-down so that users can see translated versions of an article from the article detail page. You implement the language drop-down by adding the translated answer selector widget to the article detail page.

Users select a locale from the language drop-down to see the article and its content in the selected locale. The language drop-down displays locales for only the published articles. In addition, a user can see translated versions of an article based on the usergroup access at the article level.

  1. Edit the file:

    cp/customer/development/views/pages/answer/answer_view.php
  2. Add the language drop-down by adding this line:

    <rn:widget path="okcs/OkcsTranslatedAnswerSelector"/>

    within this section:

    <div class="rn_OkcsAnswerAction">
    	<rn:widget path="okcs/SubscriptionButton"/>
    	<rn:widget path="okcs/OkcsRecommendContent"/>
    </div>
  3. Specify the label attribute to change label for the drop-down as follows:

    <rn:widget path="okcs/OkcsTranslatedAnswerSelector" label_drop_down="<label_name>"/>

Here’s an example on how to include the language drop-down in the answer detail (answer_view.php) page:

<div class="rn_Container">
	<rn:condition config_check="OKCS_ENABLED == true">
		<div class="rn_ContentDetail">
			<rn:meta title="#rn:php:\RightNow\Libraries\SEO::getDynamicTitle('answer', 
			\RightNow\Utils\	Url::getParameter('a_id'))#" template="okcs_standard.php"  
			clickstream="answer_view"/>
			<div class="rn_PageTitle rn_RecordDetail">
				<rn:widget path="okcs/OkcsProductCategoryBreadcrumb" display_first_item="true"/>
				<div class="rn_OkcsAnswerAction">
					<rn:widget path="okcs/SubscriptionButton"/>
					<rn:widget path="okcs/OkcsRecommendContent"/>
					<rn:widget path="okcs/OkcsTranslatedAnswerSelector"/>
				</div>
				<rn:widget path="okcs/AnswerTitle">
			</div>
			<div class="rn_AnswerView">
				<rn:widget path="okcs/AnswerStatus">
				<div class="rn_SectionTitle"></div>
				<rn:widget path="okcs/AnswerContent">
			</div>
			<div class="rn_DetailTools rn_HideInPrint">
				<div class="rn_Links">
					<rn:widget path="okcs/OkcsEmailAnswerLink"/>
				</div>
			</div>
			<rn:widget path="okcs/DocumentRating"/>
			<rn:widget path="okcs/OkcsRelatedAnswers"/>
		</div>
		<aside class="rn_SideRail" role="complementary">
			<rn:widget path="okcs/OkcsRecentlyViewedContent"/>
		</aside>
	</rn:condition>
</div>