xx_Custom.pm not work properly

Moderator: crythias

Locked
yuri0001
Znuny superhero
Posts: 630
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

xx_Custom.pm not work properly

Post by yuri0001 »

Good day!

1. After adding xx_Custom.pm (ru_Custom.pm - contains only nontranslating terms in original file ru.pm) file, not work translation from original xx.pm language file (ru.pm).
2. if I add a few operators such as

Code: Select all

$Self->{Translation} = {
        'Admin' => '7777777',
        'Preferences updated successfully!' => 'ОБНОВЛЕНО',
        'Edit personal preferences' => 'Редактировать настройки',
    };
    # ITSM additional terms
    $Self->{Translation} = {
        'CMDB' => 'БД CMDB',
        'Hardware' => 'Прочее "железо"',
    };
with multiple terms in one statement - runs only the last operator
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
root
Administrator
Posts: 4254
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: xx_Custom.pm not work properly

Post by root »

Hi,

your last term override the first one, you have to rewrite them like:

Code: Select all

$Self->{Translation} = {
        'Admin' => '7777777',
        'Preferences updated successfully!' => 'ОБНОВЛЕНО',
        'Edit personal preferences' => 'Редактировать настройки',
        # ITSM additional terms
        'CMDB' => 'БД CMDB',
        'Hardware' => 'Прочее "железо"',
    };
hth, Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
yuri0001
Znuny superhero
Posts: 630
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: xx_Custom.pm not work properly

Post by yuri0001 »

Thanks, I understand you!
But what can be said for the first question? The attempt to add such operator as in the second question (with your remarks) into ru_Custom.pm file off work from the file ru.pm (translated terms only from Custom file). If i add each new term translation as separate operator, not in one - it works well - as addition for ru.pm. Is it indicate that $Self{Translate} with few terms in it can be only one in module? I'm not good at PERL - that's why my questions. :?
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
Locked