Frontend Translation File

Moderator: crythias

Locked
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Frontend Translation File

Post by Misa Zed »

...not working for me ! version 3.0 , language sr_Latn (Serbian Latin) .
I tried everything, for example AgentTicketMove.pm has 2 lines I can't translate except directly in file .
Manual says for specific frontend modules use (in my case it would be) sr_Latn_AgentTicketMove.pm with translations or more general sr_Latn_Custom.pm .
It ain't working neither way, what's the catch ?

Thanks, Miša
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

OK, as I see it appears to be a middleware module...anyway with a .pm suffix .
Could anyone confirm those kind of files couldn't be translated ?
Or if they could...how !


# web agent middle ware modules
...
use Kernel::Modules::AgentTicketMove;
...
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Frontend Translation File

Post by ferrosti »

openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

Thanks Ferrosti but I already gone through that word by word...tried & tried...not working !
Here is my sr_Latn_AgentTicketMove.pm
As you can see I changed original text in AgentTicketMove.pm to be shure I'm on the right spot...all I get is XXXXXXXXXX.



# --
# Kernel/Language/sr_Latn_AgentTicketMove.pm - provides xx Kernel/Modules/*.pm module language translation
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: sr_Latn_AgentTicketMove.pm,v 1.10 2009/02/16 10:18:52 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Language::sr_Latn_AgentTicketMove;

use strict;
use warnings;

use vars qw($VERSION);
$VERSION = qw($Revision: 1.10 $) [1];

sub Data {
my $Self = shift;

# $$START$$

#$Self->{Translation}->{"Sorry, you need to be the owner to do this action!"} = "Morate biti vlasnik da bi izvr¹ili ovu akciju !";
#$Self->{Translation}->{'Please change the owner first.'} = 'Promenite vlasnika.';
$Self->{Translation}->{'XXXXXXXXXX.'} = 'Promenite vlasnika.';

# $$STOP$$
}

1;
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Frontend Translation File

Post by ferrosti »

It could be more easy for you to go for the custom translation file. See a few lines below in the manual.

XXXXXXXXXX is the text it is looking for to be translated. Copy the text you want to be translated from the frontend into this part and you should be ready to go.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

I tried that in the first place...
I know it looks for XXXXXXXXXX. in the AgentTicketMove, as I said I intentionally placed it there to be shure it's unique
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Frontend Translation File

Post by ferrosti »

Another 'point of failure' could be that in the .dtl this text is not marked in a way to be translated.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

OK, here is the part of interest in AgentTicketMove.pm , notice in the meantime I changed text to translate into 123456789 ":

# check if ticket is locked
if ( $Self->{TicketObject}->TicketLockGet( TicketID => $Self->{TicketID} ) ) {
my $AccessOk = $Self->{TicketObject}->OwnerCheck(
TicketID => $Self->{TicketID},
OwnerID => $Self->{UserID},
);
if ( !$AccessOk ) {
my $Output = $Self->{LayoutObject}->Header(
Type => 'Small',
);
$Output .= $Self->{LayoutObject}->Warning(
Message => "Sorry, you need to be the owner to do this action!",
Comment => '123456789',
);

# show back link
$Self->{LayoutObject}->Block(
Name => 'TicketBack',
Data => { %Param, TicketID => $Self->{TicketID} },
);

$Output .= $Self->{LayoutObject}->Footer(
Type => 'Small',
);
return $Output;
}
}

Also I would like to translate Message line not only Comment but because of double quotes skipped it for now...
In AgentTicketMove.dtl I can't find any reference ?
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

OK, here is the part from Warning.dtl that actually outputs...
Translation works for $Text constants but obviously not fot $Data variables that are set in AgentTicketMove.pm .
Could anyone from OTRS-team confirm that so I could stop busting my head ?


<div class="Header">
<h2>$Text{"Warning"}</h2>
</div>
<div class="Content">
<h4>
$Text{"Message"}: <span class="Error">$Data{"Message"}</span>
</h4>

<p class="SpacingTop">
$Data{"Comment"}
</p>

<p class="SpacingTop">
<a href="#" id="GoBack">$Text{"Go back to the previous page"}</a>
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

I suppose there is no other way then translate directly in code...

another thing related to translations...
Is there a way that a Login screen could be translated other then directly in source ?
For example, CustomerLogin.dtl...something like this :

<!-- dtl:block:LostPassword -->
<div id="Reset">
<a href="#Login" class="InlineNavigation">&larr; $Text{"Back"}</a>
<h2>$Text{"Request new password"}</h2>
...

There is $Text constant that SHOULD be translatable...but...seems like it's not working unless you are logged...but user has forgotten user name or password and keeps getting messages in English .
I tried everything I could think of .

Miša
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Frontend Translation File

Post by ferrosti »

Last case it would be useful to set your default language to what you need.

For your .dtl you could try it like this:

Code: Select all

$Text{"$Data{"Message"}"}
(I am not sure whether this is up to date on 3.0, since it is not mentioned in the manual any more)
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Misa Zed
Znuny newbie
Posts: 10
Joined: 17 Mar 2011, 17:10
Znuny Version: 3.0

Re: Frontend Translation File

Post by Misa Zed »

It doesn't accept sr_Latn as default language, reports Error...

I thought about changing source that way but it loses the point anyway, so I edited the text directly in code...seems there is no other way .
Also, I can't change utf-8 character code globaly, only in sr_Latn.pm (set to iso-8859-2) so specific characters couldn't be rendered...

Thanks for your time !
Locked