add language translation

English! place to talk about development, programming and coding
Post Reply
whitepito
Znuny newbie
Posts: 1
Joined: 10 Feb 2015, 08:49
Znuny Version: version 3.3

add language translation

Post by whitepito »

Hi,
I have some problem with adding language translation to OTRS. I already write coding in .pm file which stated at below but when I test interface, the language test could not read on OTRS interface, it is appear (??????) as below picture. do you have any solution ?. please help me
Thank you.

Image

Code: Select all

 
package Kernel::Language::th;
use strict;
use warnings;
use vars qw(@ISA $VERSION);
sub Data {
    my $Self = shift;
    # $$START$$
    # possible charsets
    $Self->{Charset} = ['utf-8', ];
    # date formats (%A=WeekDay;%B=LongMonth;%T=Time;%D=Day;%M=Month;%Y=Jear;)
    $Self->{DateFormat} = '%D.%M.%Y %T';
    $Self->{DateFormatLong} = '%A %D %B %T %Y';
    $Self->{DateFormatShort} = '%D.%M.%Y';
    $Self->{DateInputFormat} = '%D.%M.%Y';
    $Self->{DateInputFormatLong} = '%D.%M.%Y - %T';
    $Self->{Translation} = {
    # Template: AAABase
    'Yes' => 'ใช่',
    'update' => 'อัปเดต,
};
    # $$STOP$$
    return 1;
    }
    1;
    
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: add language translation

Post by reneeb »

add

Code: Select all

use utf8;
after

Code: Select all

use warnings;
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
LuisGRD
Znuny newbie
Posts: 2
Joined: 28 May 2014, 22:47
Znuny Version: 3.3.5
Real Name: Luis
Company: Gridshield

Re: add language translation

Post by LuisGRD »

Hi,

You need to change the file name to:
package Kernel::Language::th_Custom;

and the file that you create need to have the same name "th_Custom.pm".


This is the content of the file that you need to create:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

package Kernel::Language::th_Custom;

use strict;
use warnings;

sub Data {
    my $Self = shift;

    # $$START$$
    # possible charsets
    $Self->{Charset} = ['utf-8', ];
    # date formats (%A=WeekDay;%B=LongMonth;%T=Time;%D=Day;%M=Month;%Y=Year;)
    $Self->{DateFormat}          = '%D/%M/%Y - %T';
    $Self->{DateFormatLong}      = '%A, %D %B %Y - %T';
    $Self->{DateFormatShort}     = '%D/%M/%Y';
    $Self->{DateInputFormat}     = '%D/%M/%Y';
    $Self->{DateInputFormatLong} = '%D/%M/%Y - %T';

    # csv separator
    $Self->{Separator} = ';';

    $Self->{Translation} = {

        # Template: AAABase
        'Yes' => 'ใช่',
        'update' => 'อัปเดต,
	 };
    # $$STOP$$
    return;
}

1;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

hope that this can help you with your language issue.
Last edited by crythias on 11 Feb 2015, 02:09, edited 1 time in total.
Reason: [code] tags for sanity
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: add language translation

Post by reneeb »

@LuisGRD Please use the

Code: Select all

 tags when you post code. That makes it more readable. And again, "use utf8;" is missing. "use utf8" tells the Perl interpreter that there are non-Latin1 characters in the code.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply