How add translate

Hi, there is a question.
I do the translation into Russian, already began and for check I want it to add to myself. As to make it.

What is necessary except copying of new files? After all translations and checks, I will make unloading in the general Git.

1 Like

Ok i find some config files.

First \Asqatasun\web-app\asqatasun-web-app\src\main\webapp\WEB-INF\view\template\lang-box.jsp

And add new line:
<%@ page contentType=“text/html;charset=UTF-8” pageEncoding=“UTF-8”%>
<%@ taglib uri=“http://java.sun.com/jsp/jstl/core” prefix=“c”%>
<%@ taglib uri=“http://java.sun.com/jsp/jstl/fmt” prefix=“fmt” %>
<%@ taglib prefix=“sec” uri=“http://www.springframework.org/security/tags” %>
<%@ taglib prefix=“fn” uri=“http://java.sun.com/jsp/jstl/functions”%>

<c:set var="tgLogoUrl">
    <c:url value="/Images/Logo-Asqatasun.org-75dpi-210x95-transp.png"/>  
</c:set>

<c:set var="properQueryString" scope="page" value="${fn:replace(pageContext.request.queryString, '&', '&amp;')}"/>
<c:choose>
    <c:when test="${not empty pageContext.request.queryString}">
        <c:choose>
            <c:when test="${fn:contains(pageContext.request.queryString, 'lang=en')}">
                <c:set var="enUrl" scope="request" value="?${properQueryString}"/>
                <c:set var="frUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=fr')}" />
                <c:set var="esUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=es')}" />
		<c:set var="ruUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=ru')}" />
            </c:when>
	   <c:when test="${fn:contains(pageContext.request.queryString, 'lang=ru')}">
                <c:set var="ruUrl" scope="request" value="?${properQueryString}"/>
                <c:set var="frUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=fr')}" />
                <c:set var="esUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=es')}" />
		<c:set var="enUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=fr', 'lang=en')}" />
            </c:when>
            <c:when test="${fn:contains(pageContext.request.queryString, 'lang=fr')}">
                <c:set var="frUrl" scope="request" value="?${properQueryString}"/>
                <c:set var="enUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=fr', 'lang=en')}" />
                <c:set var="esUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=fr', 'lang=es')}" />
		<c:set var="ruUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=ru')}" />
            </c:when>
            <c:when test="${fn:contains(pageContext.request.queryString, 'lang=es')}">
                <c:set var="esUrl" scope="request" value="?${properQueryString}"/>
                <c:set var="enUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=es', 'lang=en')}" />
                <c:set var="frUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=es', 'lang=fr')}" />
		<c:set var="ruUrl" scope="request" value="?${fn:replace(properQueryString, 
                    'lang=en', 'lang=ru')}" />
            </c:when>
            <c:otherwise>
                <c:set var="frUrl" scope="request" value="?${properQueryString}&amp;lang=fr"/>
                <c:set var="esUrl" scope="request" value="?${properQueryString}&amp;lang=es"/>
                <c:set var="enUrl" scope="request" value="?${properQueryString}&amp;lang=en"/>
                <c:set var="ruUrl" scope="request" value="?${properQueryString}&amp;lang=ru"/>
            </c:otherwise>
        </c:choose>
    </c:when>
    <c:otherwise>
        <c:set var="frUrl" scope="request" value="?lang=fr"/>
        <c:set var="esUrl" scope="request" value="?lang=es"/>
        <c:set var="enUrl" scope="request" value="?lang=en"/>
        <c:set var="ruUrl" scope="request" value="?lang=ru"/>
    </c:otherwise>
</c:choose>
<div id="lang-switcher">
    <a href="${enUrl}" title="Switch to english" lang="en">
        <abbr title="English">EN</abbr>
    </a>
    <a href="${frUrl}" title="Passer en français" lang="fr">
        <abbr title="Français">FR</abbr>
    </a>
    <a href="${esUrl}" title="Cambaiar a espaГ±ol" lang="es">
        <abbr title="EspaГ±ol">ES</abbr>
    </a>
	<a href="${ruUrl}" title="Switch to Russian" lang="ru">
        <abbr title="Russian">RU</abbr>
    </a>
</div>

And i did it :slightly_smiling:

All you need, it’s add new line to file, and upload file.

Hi,

All you need to do is update all the .properties files in the web-app subproject.

But you did on your own, congrats…

So amazing to see the application in russian…

Thanks a lot…

Regards

Koj

1 Like